Пример #1
0
    void Update()
    {
        GameObject    Manager     = GameObject.Find("GameManager");
        O_GameManager gamemanager = Manager.GetComponent <O_GameManager>();

        enemyCount = gamemanager.spawnCount;
    }
Пример #2
0
    void OnTriggerEnter(Collider other)
    {
        GameObject    Manager     = GameObject.Find("GameManager");
        O_GameManager gamemanager = Manager.GetComponent <O_GameManager>();

        if (other.CompareTag("Player"))
        {
            DestroyProjectile();
            O_GameManager.MinusLives(1);
        }
    }
Пример #3
0
    void OnTriggerEnter(Collider other)
    {
        GameObject    Manager     = GameObject.Find("GameManager");
        O_GameManager gamemanager = Manager.GetComponent <O_GameManager>();

        if (other.gameObject.tag == "Enemy")
        {
            O_GameManager.AddPoints(killPoints);
            Destroy(other.gameObject);
            Destroy(this.gameObject);
            gamemanager.spawnCount--;
        }
    }
Пример #4
0
 void Awake()
 {
     if (m_instance != null && m_instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         m_instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }