Esempio n. 1
0
    void Awake()
    {
        phase2 = FindObjectOfType <Phase2Manager>();
        //snap to match grid
        Helper.SnapToGrid(this.transform);
        //cost = price;
        Phase2Manager.currency -= cost;
        phase2.UpdateCurrency();

        SoundManager.PlaySound("place2");
    }
Esempio n. 2
0
    //Determine if this object should be deleted
    void checkIfDead()
    {
        if (null == BuildFunctions.playArea[(int)transform.position.x, (int)transform.position.y])
        {
            //return some cost of this item from the total currency
            Phase2Manager.currency += cost;
            //update the currency ui element
            phase2.UpdateCurrency();

            SoundManager.PlaySound("delete");
            Destroy(this.gameObject);
        }
    }
Esempio n. 3
0
    void Awake()
    {
        //find the phase 2 manager script
        phase2 = FindObjectOfType <Phase2Manager>();

        //snap to match grid
        Helper.SnapToGrid(this.transform);

        //remove the cost of this item from the total currency
        Phase2Manager.currency -= cost;

        //update the currency ui element
        phase2.UpdateCurrency();

        SoundManager.PlaySound("place1");
    }