Pigman levelswitch implement

This commit is contained in:
2025-12-17 19:18:32 +01:00
parent 48f2c148f5
commit 0ee9e69d71
20 changed files with 1595 additions and 205 deletions

View File

@@ -0,0 +1,29 @@
using System.Collections;
using UnityEngine;
public class PigManBehaviour : MonoBehaviour
{
private Animator _animator;
public bool canEatCards;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
canEatCards = true;
StartCoroutine(CheckIfShouldEatCard(2));
_animator = GetComponent<Animator>();
}
private IEnumerator CheckIfShouldEatCard(float seconds)
{
while(canEatCards)
{
yield return new WaitForSeconds(seconds);
if (Random.value < 0.62f)
{
_animator.SetTrigger("eatCards");
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 07f9cf64792aa3e40819a65a1f1a3cc9

View File

@@ -44,6 +44,6 @@ public class TrashmazeClosedBehaviour : MonoBehaviour
private void GiveCactusTimelineStopped(PlayableDirector director)
{
_director.stopped -= GiveCactusTimelineStopped;
SwapPulverStung();
}
}