Пример #1
0
    // Called from Boss script when hp < 0
    public void BossDeactivate()
    {
        GameObject[] objs = GameObject.FindGameObjectsWithTag("Spawner");
        foreach (GameObject obj in objs)
        {
            SpawnObjects spawner = obj.GetComponent <SpawnObjects> ();
            if (spawner != null)
            {
                if (spawner.transform.position.y < 6)
                {
                    Destroy(spawner.gameObject);
                    continue;
                }
                spawner.ResumeMovement();
            }
            else
            {
                BossScroller boss = obj.GetComponent <BossScroller> ();
                if (boss != null)
                {
                    boss.ResumeMovement();
                }
            }
        }
        switch (name)
        {
        case "BossFightGenie":
            gameMgr.GotoSection(2);
            break;

        case "BossFightSphinx":
            gameMgr.GotoSection(4);
            break;

        case "BossFightAladdin":
            gameMgr.GotoSection(6);
            break;
        }

        Destroy(gameObject);
    }