Exemple #1
0
 // Start is called before the first frame update
 void Start()
 {
     GetWaypoints();
     transform.position = waypoints[waypointIndex].transform.position;
     sunTracker         = GameObject.Find("GameMaster").GetComponent <SunTracker>();
     brainsTracker      = GameObject.Find("GameMaster").GetComponent <BrainsTracker>();
 }
 void Awake()
 {
     if (instance != null)
     {
         Debug.LogWarning("More than one instance of sun tracker found");
         return;
     }
     instance = this;
 }
Exemple #3
0
        public Program()
        {
            Runtime.UpdateFrequency = UpdateFrequency.Update100;

            tracker1 = new SunTracker(GridTerminalSystem, "Solar Panel Control1", "Solar Rotor 1a", "Solar Rotor 1b", Echo);
            tracker2 = new SunTracker(GridTerminalSystem, "Solar Panel Control2", "Solar Rotor 2a", "Solar Rotor 2b", Echo);


            if (tracker1.Error)
            {
                Runtime.UpdateFrequency = UpdateFrequency.None;
                return;
            }

            Echo("Running");
        }
    public void AddUpgrades()
    {
        SunTracker sunTracker = SunTracker.instance;

        Tower towerToUpgrade = SelectTower.instance.selected;

        if (sunTracker.HaveEnoughSun(cost) && towerToUpgrade.killCount >= killsNeeded)
        {
            sunTracker.MinusSun(cost);
            towerToUpgrade.range            += rangeUpgrade;
            towerToUpgrade.damage           += damageUpgrade;
            towerToUpgrade.attackSpeed      += attackSpeedUpgrade;
            towerToUpgrade.projectileHealth += projectileHealthUpgrade;
            towerToUpgrade.projectileSpeed  += projectileSpeedUpgrade;
            towerToUpgrade.slowAmount       += projectileSlowUpgrade;
            towerToUpgrade.slowTime         += projectileSlowDurationUpgrade;
            towerToUpgrade.sunReward        += sunRewardUpgrade;

            if (towerToUpgrade.name == "Torchwood")
            {
                TorchwoodScript t = towerToUpgrade.GetComponent <TorchwoodScript>();
                t.damageIncrease += torchwoodDamageIncrese;
            }

            if (changeProjectileTo != null)
            {
                towerToUpgrade.projectile = changeProjectileTo;
            }


            towerToUpgrade.sellValue += cost / 2;
            towerToUpgrade.path1Purchased++;
        }
        else
        {
            Debug.Log("not enough sun / kills");
        }

        if (towerToUpgrade.killCount < killsNeeded)
        {
            sunTracker.FlashKillsText();
        }
    }
Exemple #5
0
 void Start()
 {
     level      = FindObjectOfType <LevelControler>();
     sunManager = FindObjectOfType <SunTracker>();
 }
 void Start()
 {
     sunTracker = SunTracker.instance;
 }