Esempio n. 1
0
 void OnDisable()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
Esempio n. 2
0
    void Start()
    {
        myTransform = transform;
        lastPos     = myTransform.position;     // record this position


        buildControlText = buildControlBttn.GetComponentInChildren <Text> ();

//		townTile = mapScript.GetTownTile ();
//		ShowBasicBuildings();

        townResources = townRes.GetComponent <TownResources> ();

//		CheckWhatTile ();
        // INSTEAD OF CHECKING TILE AT THE BEGINNING, CHECK TILE WHEN PLAYER PRESSES BUILD CONTROL BUTTON
        buildControlBttn.image.sprite = emptyButtonSprite;
        buildControlText.text         = "BUILD";
    }
Esempio n. 3
0
    public Mouse_Controls mouse;     // to tell it to stop selecting


    void Start()
    {
        // check if name is null to see if this is a new gatherer or if it's already on the list
        if (name == null)
        {
            name = GetName(false);
        }

        myTransform   = transform;
        town          = GameObject.FindGameObjectWithTag("Town_Central");
        townResources = town.GetComponent <TownResources> ();
        townCentral   = town.GetComponent <Town_Central> ();
        GameObject map = GameObject.FindGameObjectWithTag("Map_Manager");

        mapManager = map.GetComponent <Map_Manager> ();
        mouse      = map.GetComponent <Mouse_Controls> ();

        gathering = true;
    }
Esempio n. 4
0
    void Awake()
    {
        InitFarmValues(myBuildMaterial);          // init values according to material of this building

        myTransform = transform;
        GameObject town = GameObject.FindGameObjectWithTag("Town_Central");

        townCentral   = town.GetComponent <Town_Central> ();
        townResources = town.GetComponent <TownResources> ();


        if (townTProps == null)
        {
            townTProps = GetComponentInParent <TownTile_Properties> ();
        }

        if (townCentral != null)
        {
            townCentral.farms.Add(this);
            farmListID = townCentral.farms.Count - 1;
        }
    }
Esempio n. 5
0
 void OnEnable()
 {
     Instance = this;
 }
Esempio n. 6
0
 void OnDisable()
 {
     if (Instance == this) Instance = null;
 }
Esempio n. 7
0
 void OnEnable()
 {
     Instance = this;
 }