예제 #1
0
    void OnTriggerEnter2D(Collider2D otherCollider)
    {
        buildingScript building = otherCollider.gameObject.GetComponent <buildingScript> ();

        if (building != null)
        {
            building.hasReturned = true;
        }
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        planningStage = true;
        canMoveArrows = true;
        arrowCounter  = GameObject.FindGameObjectsWithTag("arrow");
        arrowCount    = arrowCounter.Length;
        GameObject buildingObject = GameObject.Find("Building");

        if (buildingObject != null)
        {
            building = buildingObject.GetComponent <buildingScript>();
        }
        mineralCounter = GameObject.FindGameObjectsWithTag("Pick-up");
        mineralsTotal  = mineralCounter.Length;
    }