Ejemplo n.º 1
0
 public override void Create()
 {
     base.Create();
     if (objBackground == null)
     {
         objBackground = ResourceLoad.GetObject("KittyFace", string.Format("{0}/Model/KittyEffect/Background", ResourceLoad.CheckHeight));
     }
 }
Ejemplo n.º 2
0
    private void SetCharacterFaceUV()
    {
        int packtype = Main.game.GetPackageType();

        for (int kittylevel = 0; kittylevel < m_dKittyLevelMax; kittylevel++)
        {
            GameObject tmpObj;

            string ObjectPath;
            if (packtype < 10)
            {
                ObjectPath = string.Format("{0}/Mobile/EZGUI/Game/Kitty/Character/Skin0{1}/Face/Level{2}", ResourceLoad.CheckHeight, packtype, kittylevel);
            }
            else
            {
                ObjectPath = string.Format("{0}/Mobile/EZGUI/Game/Kitty/Character/Skin{1}/Face/Level{2}", ResourceLoad.CheckHeight, packtype, kittylevel);
            }
            Object obj = ResourceLoad.GetObject("KittyFace", ObjectPath);
            if (objCharacter == null)
            {
                objCharacter = obj;
            }
            tmpObj = Instantiate(obj);

            Rect tmpUV1 = (Rect)tmpObj.GetComponent <UIButton>().GetUVs();
            tmpObj.GetComponent <UIButton>().SetState((int)UIButton.CONTROL_STATE.OVER);
            Rect tmpUV2 = (Rect)tmpObj.GetComponent <UIButton>().GetUVs();
            tmpObj.GetComponent <UIButton>().SetState((int)UIButton.CONTROL_STATE.ACTIVE);
            Rect tmpUV3 = (Rect)tmpObj.GetComponent <UIButton>().GetUVs();

            SetFaceUVs(kittylevel, tmpUV1);
            SetFaceUVs(kittylevel, tmpUV2);
            SetFaceUVs(kittylevel, tmpUV3);

            DestroyImmediate(tmpObj);
        }
    }