Example #1
0
 // Use this for initialization
 void OnEnable()
 {
     cgl   = GameObject.FindGameObjectWithTag("GameController").GetComponent <CoreGameLoop>();
     ammo  = new Amunition(450, 30);
     props = new M4A1WeaponProperties();
     rof   = this.getRof();
     gunSmoke.Stop();
     melee = meleeGo.GetComponent <MeleeController> ();
 }
Example #2
0
    void Awake()
    {
        remainIraqi = new GameObject();
        remainIraqi.AddComponent <GUIText>();
        remainIraqi.transform.position = new Vector3(0.05f, 0.4f, 0.0f);
        remainIraqi.guiText.text       = "";

        cgl             = GetComponent <CoreGameLoop>();
        spawnPoints     = GameObject.FindGameObjectsWithTag("EnemySpawnPoint");
        enemiesPerLevel = new int[] { 0, 1, 2, 3, 6, 10, 15, 21, 28, 36, 45 };
    }
Example #3
0
    void dead()
    {
        GameObject   coreGame = GameObject.FindGameObjectWithTag("GameController");
        CoreGameLoop cgl      = coreGame.GetComponent <CoreGameLoop>();

        // Player
        if (gameObject.tag == "Player")
        {
            cgl.gameOver = 1;
            Destroy(gameObject);
            return;
        }

        //Enemy
        spawnPickup();
        EnemySpawner enemySpawner = coreGame.GetComponent <EnemySpawner> ();

        enemySpawner.enemiesCounterKilled++;

        // this.gameObject.SetActive(false);
        Destroy(gameObject);
    }