コード例 #1
0
    public static void Load()
    {
        if (_Property != null)
        {
            return;
        }

        _Property = UnityEngine.Object.Instantiate(
            (GameObject)Resources.Load("UI/property.construction_area", typeof(GameObject)),
            GameObject.Find("UI").transform);
        _Property.name = "Property.ConstructionArea";
        _Property.SetActive(false);

        _Progress = _Property.transform.Find("Progress").GetComponent <ProgressBehavior>();
        _Builder  = _Property.transform.Find("Stats.BuilderAnts/Current").GetComponent <Text>();
    }
コード例 #2
0
    private static void EnsurePrefab()
    {
        if (_Property != null)
        {
            return;
        }

        _Property = UnityEngine.Object.Instantiate(
            (GameObject)Resources.Load("UI/property.farm", typeof(GameObject)),
            GameObject.Find("UI").transform);
        _Property.name = "Property.Farm";
        _Property.SetActive(false);

        _Progress = _Property.transform.Find("Progress").GetComponent <ProgressBehavior>();
        _Worker   = _Property.transform.Find("Stats.WorkerAnts/Current").GetComponent <Text>();
        _Food     = _Property.transform.Find("Stats.Food/Current").GetComponent <Text>();
    }