示例#1
0
    public static RepairingController Get()
    {
        if (_thisInstance == null)
        {
            GameObject newGameObject = new GameObject("RepairingController");
            _thisInstance = newGameObject.AddComponent <RepairingController>();
        }

        return(_thisInstance);
    }
示例#2
0
 void Awake()
 {
     if (_thisInstance == null)
     {
         _thisInstance = this;
     }
     else
     {
         Destroy(this);
     }
 }
示例#3
0
文件: Enemy.cs 项目: kappa91/GGJ20
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (move && other.gameObject.tag.Equals("Player"))
        {
            //    //DAMAGE TO PLAYER
            //    GameManager.Get()._anim.SetTrigger("damageTrigger");
            //    GameManager.Get().RepairExit();
            //    move = false;
            //    //animazione e destroy
            //    Destroy(gameObject);
            if (!isDead)
            {
                if (GameManager.Get().isAttack)
                {
                    isDead = true;
                    anim.SetTrigger("die");
                    StartCoroutine(WaitToDestroy());
                    StartCoroutine(AudioManager.Get().PlayIndependentSoundClipRoutine(enemyDestroyedSound));
                    TimeManager.Get().AddSeconds();
                }
            }
        }
        //else
        if (move && other.gameObject.tag.Equals("Car"))
        {
            //DAMAGE TO CAR
            move = false;
            other.gameObject.GetComponent <Animator>().SetTrigger("explode");

            if (other.gameObject.GetComponent <ColliderController>().spot.status != Spot.Status.level1)
            {
                other.gameObject.GetComponent <ColliderController>().spot.status--;
                other.gameObject.GetComponent <ColliderController>().spot.currentButtonCounter = 0;
                RepairingController.Get().SelectLevel(other.gameObject.GetComponent <ColliderController>().spot);
            }
            StartCoroutine(AudioManager.Get().PlayIndependentSoundClipRoutine(carDestroyedSound));


            //animazione e destroy
            Destroy(gameObject);
        }
    }
示例#4
0
 private void Start()
 {
     RepairingController.Get().onSpotDoneDelegate += CheckGameWin;
 }