Exemplo n.º 1
0
    public virtual void EnemyDeathEnd()
    {
        int        coinflip   = (int)(Random.Range(0, 2));
        LvlManager lvlManager = GameObject.Find("LevelManager").GetComponent <LvlManager>();

        //Spawn Reward
        if (coinflip < 1)
        {
            lvlManager.SpawnRandomReward(gameObject.transform.position);
        }

        //save state
        PlayerPrefs.SetInt(objectID, 1);
        lvlManager.EnemyKilled();

        Destroy(gameObject);
    }
Exemplo n.º 2
0
    public override void EnemyDeathEnd()
    {
        LvlManager lvlManager = GameObject.Find("LevelManager").GetComponent <LvlManager>();

        //Spawn Reward
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x, gameObject.transform.position.y - 5.8f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x - 2.5f, gameObject.transform.position.y - 5.8f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x + 2.5f, gameObject.transform.position.y - 5.8f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x, gameObject.transform.position.y - 4f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x - 2.5f, gameObject.transform.position.y - 4f, gameObject.transform.position.z));
        lvlManager.SpawnRandomReward(new Vector3(gameObject.transform.position.x + 2.5f, gameObject.transform.position.y - 4f, gameObject.transform.position.z));

        //Spawn Orb
        Instantiate(orb, gameObject.transform.position, Quaternion.identity);

        //cutscene stuff
        finalBossCutscene.BossDied();

        //save state
        PlayerPrefs.SetInt(objectID, 1);
        lvlManager.EnemyKilled();

        Destroy(gameObject);
    }