Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        float dist = navMesh.remainingDistance;

        if (dist != Mathf.Infinity && navMesh.pathStatus == NavMeshPathStatus.PathComplete & dist < targetDistance)
        {
            // Finish
            if (FinanceManager.TryWithdrawal(banishCost))
            {
                LogTurretDamage();
                WaveManager.CreeperDies();
            }
            else
            {
                WaveManager.Defeat();
            }
            Destroy(gameObject);
        }
    }
Esempio n. 2
0
 public void BuildTurret()
 {
     Debug.Log("Build Turret");
     if (WaveManager.getCurrentPhase() != WaveManager.WaveManagerPhase.StopGame)
     {
         //Check if already built, try to upgrade?
         if (MagicStoneInterface.GetTurret() != null)
         {
             //Turret already exist. We need to check it for upgrade possibilities.
             if (2 > 3)                   //FIXME check for upgradeability
             //	Upgrade
             {
             }
             else
             {
                 //FIXME sfx error building/upgrading turret. NO WAI
             }
         }
         else
         {
             if (FinanceManager.TryWithdrawal(1))                    //FIXME we need cost variable
             //gameObject.SetActive (false);
             {
                 if (buildingActivity != null)
                 {
                     buildingActivity.SetActive(true);
                 }
                 StartCoroutine("BuildTurretCoroutine");
             }
             else
             {
                 //FIXME sfx turret build error no money
             }
         }
     }
 }