Merge pull request 'DamianBranch' (#13) from DamianBranch into main

Reviewed-on: #13
This commit is contained in:
2025-10-01 12:23:54 +00:00
25 changed files with 2495 additions and 251 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 152828d0655f5c14cae91cf1cf71fd39
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,85 @@
using UnityEngine;
using Pixelplacement;
using System.Collections;
public class PicnicBehaviour : MonoBehaviour
{
[Header("Random Call Settings")]
public float getDistractedMin = 2f;
public float getDistractedMax = 5f;
public float getFlirtyMin = 1f;
public float getFlirtyMax = 3f;
private StateMachine stateMachine;
private Animator animator;
[Header("The FakeChocolate to destroy!")]
[SerializeField] private GameObject fakeChocolate; // Assign in Inspector
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
StartCoroutine(RandomFirstMethodRoutine());
}
void Awake()
{
stateMachine = GetComponent<StateMachine>();
animator = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
}
private IEnumerator RandomFirstMethodRoutine()
{
while (true)
{
float waitTime = Random.Range(getDistractedMin, getDistractedMax);
yield return new WaitForSeconds(waitTime);
FirstMethod();
}
}
private void FirstMethod()
{
Debug.Log("First method called!");
stateMachine.ChangeState("Picnic PPL Distracted");
animator.SetBool("theyDistracted", true);
StartCoroutine(RandomSecondMethodRoutine());
}
private IEnumerator RandomSecondMethodRoutine()
{
float waitTime = Random.Range(getFlirtyMin, getFlirtyMax);
yield return new WaitForSeconds(waitTime);
SecondMethod();
}
private void SecondMethod()
{
Debug.Log("Second method called!");
stateMachine.ChangeState("Picnic PPL Chilling");
animator.SetBool("theyDistracted", false);
}
public void triedToStealChocolate()
{
animator.SetTrigger("theyAngry");
//stateMachine.ChangeState("Picnic PPL Angry");
Debug.Log("Hey! Don't steal my chocolate!");
}
public void destroyFakeChocolate()
{
if (fakeChocolate != null)
{
Destroy(fakeChocolate);
fakeChocolate = null; // Optional: clear reference
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0a0d74ee1aa43b54ab5d08005bdd9b16