コード例 #1
0
    // Use this for initialization
    void Start()
    {
        own         = 0;
        drag        = transform.parent.gameObject;
        drag_script = drag.GetComponent <Drag>();
        drag_script.AddList(gameObject);
        central     = GameObject.Find("Central");
        central_scr = central.GetComponent <Central>();
        if (type == 0)
        {
            own = central_scr.dog;
        }
        else if (type == 1)
        {
            own = central_scr.chicken;
        }
        guiStyleFore = new GUIStyle();
        guiStyleFore.normal.textColor = Color.white;
        guiStyleFore.alignment        = TextAnchor.UpperCenter;
        guiStyleFore.wordWrap         = true;
        guiStyleBack = new GUIStyle();
        guiStyleBack.normal.textColor = Color.black;
        guiStyleBack.alignment        = TextAnchor.UpperCenter;
        guiStyleBack.wordWrap         = true;

        // toolTipText = name + "\n In Storage: " + own + "\n " + toolTipText;
    }
コード例 #2
0
ファイル: AnimalItem.cs プロジェクト: vietanh1441/AnimalFarm
    // Use this for initialization
    void Start()
    {
        own = 0;
        drag = transform.parent.gameObject;
        drag_script = drag.GetComponent<Drag>();
        drag_script.AddList(gameObject);
        central = GameObject.Find("Central");
        central_scr = central.GetComponent<Central>();
        if (type == 0)
        {
            own = central_scr.dog;
        }
        else if(type == 1)
        {
            own = central_scr.chicken;
        }
        guiStyleFore = new GUIStyle();
        guiStyleFore.normal.textColor = Color.white;
        guiStyleFore.alignment = TextAnchor.UpperCenter;
        guiStyleFore.wordWrap = true;
        guiStyleBack = new GUIStyle();
        guiStyleBack.normal.textColor = Color.black;
        guiStyleBack.alignment = TextAnchor.UpperCenter;
        guiStyleBack.wordWrap = true;

           // toolTipText = name + "\n In Storage: " + own + "\n " + toolTipText;
    }