Пример #1
0
    ////////////////
    //ICON
    ////////////////

    public static SCR_icon CreateIcon(string iconName, Vector3 pos)
    {
        GameObject iconInst = Instantiate(Resources.Load(("Objects/Gui/_Icon/Icon_" + iconName), typeof(GameObject)), Vector3.zero, Quaternion.identity) as GameObject;

        iconInst.name = iconName;
        SCR_icon icon = iconInst.GetComponent <SCR_icon>();

        icon.StartUp(pos);

        return(icon);
    }
Пример #2
0
    void CreateCountDown(int com)
    {
        string iconName = "CountDown";

        if (com == 3)
        {
            iconName = "Start";
        }

        SCR_icon countDownInst = SCR_gui.CreateIcon(iconName, Vector3.zero);

        if (com < 3)
        {
            string    countDownStr      = "Textures/Gui/_Icon/Text_";
            Texture[] countDownTexArray = new Texture[3] {
                Resources.Load((countDownStr + "3"), typeof(Texture)) as Texture,
                Resources.Load((countDownStr + "2"), typeof(Texture)) as Texture,
                Resources.Load((countDownStr + "1"), typeof(Texture)) as Texture
            };

            countDownInst.GetComponent <GUITexture>().texture = countDownTexArray[com];
        }
    }