示例#1
0
    private void Awake()
    {
        int type     = Random.Range(1, 3);
        int CaseTpye = type;

        switch (CaseTpye)
        {
        case 1:
            Skin1.SetActive(true);
            break;

        case 2:
            Skin2.SetActive(true);
            break;

        case 3:
            Skin3.SetActive(true);
            break;
        }
    }
示例#2
0
    void Update()
    {
        if (selectSkin1 == 1)
        {
            Skin1.SetActive(true);
            Skin2.SetActive(false);
        }
        else
        {
            Skin1.SetActive(false);
        }

        if (selectSkin2 == 2) //переключение между скинами
        {
            Skin1.SetActive(false);
            Skin2.SetActive(true);
        }
        else
        {
            Skin2.SetActive(false);
        }
    }
示例#3
0
    // Update is called once per frame
    void Update()
    {
        if (selectSkin1 == 1)
        {
            Skin1.SetActive(true);
            Skin2.SetActive(false);
            Skin3.SetActive(false);
            Skin4.SetActive(false);
            Skin5.SetActive(false);
        }
        else
        {
            Skin1.SetActive(false);
        }

        if (selectSkin2 == 2)
        {
            Skin1.SetActive(false);
            Skin2.SetActive(true);
            Skin3.SetActive(false);
            Skin4.SetActive(false);
            Skin5.SetActive(false);
        }
        else
        {
            Skin2.SetActive(false);
        }

        if (selectSkin3 == 3)
        {
            Skin1.SetActive(false);
            Skin2.SetActive(false);
            Skin3.SetActive(true);
            Skin4.SetActive(false);
            Skin5.SetActive(false);
        }
        else
        {
            Skin3.SetActive(false);
        }

        if (selectSkin4 == 4)
        {
            Skin1.SetActive(false);
            Skin2.SetActive(false);
            Skin3.SetActive(false);
            Skin4.SetActive(true);
            Skin5.SetActive(false);
        }
        else
        {
            Skin4.SetActive(false);
        }

        if (selectSkin5 == 5)
        {
            Skin1.SetActive(false);
            Skin2.SetActive(false);
            Skin3.SetActive(false);
            Skin4.SetActive(false);
            Skin5.SetActive(true);
        }
        else
        {
            Skin5.SetActive(false);
        }
    }