Example #1
0
    // Use this for initialization
    void Start()
    {
        motherShip = GameObject.Find("MotherShip").GetComponent <MotherShip>();

        totResource = GameObject.Find("Game Master").GetComponent <TotalResources>();

        AS = this.gameObject.GetComponent <AudioSource>();
    }
Example #2
0
    // public BattleShip[] BScript;


    // Use this for initialization
    void Start()
    {
        totResource = GameObject.Find("Game Master").GetComponent <TotalResources>();

        bsObj = GameObject.FindGameObjectsWithTag("Battle Ship");

        AS = this.gameObject.GetComponent <AudioSource>();
    }
Example #3
0
 protected virtual void Awake()
 {
     upgrades = transform.parent.GetComponent<Upgrades>();
     totalResources = GameObject.Find("Total Resources").GetComponent<TotalResources>();
     foreach (Transform textObj in transform)
     {
         if (textObj.gameObject.name == "Points") {
             textObj.GetComponent<TextMesh>().text = pointsSpendOnThis + "/" + upgrades.TotalPoints;
         }
         else if (textObj.gameObject.name == "Price") {
             price = int.Parse(textObj.GetComponent<TextMesh>().text);
         }
     }
 }
 protected virtual void Awake()
 {
     upgrades       = transform.parent.GetComponent <Upgrades>();
     totalResources = GameObject.Find("Total Resources").GetComponent <TotalResources>();
     foreach (Transform textObj in transform)
     {
         if (textObj.gameObject.name == "Points")
         {
             textObj.GetComponent <TextMesh>().text = pointsSpendOnThis + "/" + upgrades.TotalPoints;
         }
         else if (textObj.gameObject.name == "Price")
         {
             price = int.Parse(textObj.GetComponent <TextMesh>().text);
         }
     }
 }
Example #5
0
 protected virtual void Awake()
 {
     totalResources   = GameObject.Find("Total Resources").GetComponent <TotalResources>();
     mouse            = GameObject.Find("Main Camera").GetComponent <MouseHit>();
     shopImage        = GetComponent <Image>();
     shopImage.sprite = towerButtonSprites[selectedTower];
     foreach (Transform obj in transform)
     {
         if (obj.gameObject.name == "Price")
         {
             price = int.Parse(obj.GetComponent <Text>().text);
         }
         else if (obj.tag == "Hover")
         {
             obj.gameObject.SetActive(false);
         }
     }
 }
Example #6
0
    // Update is called once per frame
    void Update()
    {
        totResources = this.gameObject.GetComponentInParent <TotalResources>();

        timer += Time.fixedDeltaTime;

        //Cycle
        if (timer >= cycleTime)
        {
            ResourceEnergyLevelUpgrade();

            ResourceFoodLevelUpgrade();

            ResourceAmmoLevelUpgrade();


            cycle += 1;

            timer = 0;
        }

        cycleText.text = "Cycle " + cycle;
    }
 void Awake()
 {
     totalResources = GameObject.Find("Total Resources").GetComponent <TotalResources>();
     InvokeRepeating("AddScore", 0, incrementCooldown);
 }
    // Use this for initialization
    void Start()
    {
        BShip = GameObject.Find("Battle Ship 1").GetComponent <BattleShip>();

        totResource = GameObject.Find("Game Master").GetComponent <TotalResources>();
    }
 void Awake()
 {
     totalResources = GameObject.Find("Total Resources").GetComponent<TotalResources>();
     InvokeRepeating("AddScore", 0, incrementCooldown);
 }
Example #10
0
 protected virtual void Awake()
 {
     totalResources = GameObject.Find("Total Resources").GetComponent<TotalResources>();
     mouse = GameObject.Find("Main Camera").GetComponent<MouseHit>();
     shopImage = GetComponent<Image>();
     shopImage.sprite = towerButtonSprites[selectedTower];
     foreach (Transform obj in transform)
     {
         if (obj.gameObject.name == "Price")
         {
             price = int.Parse(obj.GetComponent<Text>().text);
         } else if (obj.tag == "Hover") {
             obj.gameObject.SetActive(false);
         }
     }
 }