Beispiel #1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Beispiel #2
0
 private void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.CompareTag("Enemy"))
     {
         Debug.Log("Player Hit");
         SFXmanager.PlaySound("enemySound");
         counter.GetComponent <MemoryCount>().memories--;
     }
 }
Beispiel #3
0
        private void Start()
        {
            SFXmanager = FindObjectOfType <SFXmanager>();
            _cats      = transform
                         .Cast <Transform>()
                         .Select(trans => trans.gameObject)
                         .ToArray();

            _parentObstacle = GetComponentInParent <ObstacleHolder>().Obstacle;
            if (_parentObstacle == null)
            {
                Debug.LogError($"No obstacle found above {name}", this);
            }

            Obstacle.OnObstacleEvent += OnObstacleEvent;
            GameManager.ResetEvent   += OnGameReset;

            SetFrameActive(0);
            if (testOnStart)
            {
                Animate();
            }
        }
Beispiel #4
0
 private void Awake()
 {
     Instance = this;
 }