Beispiel #1
0
    public void OnInit(IStateMgr mgr)
    {
        this.mgr = mgr;
        //var back = new CLUI.CLUI_Node_Box("_back");
        //back.rectScale = CLUI_Border.ScaleFill;
        //mgr.nodeUIRoot.AddNode(back);

        //guiBack = new CLUI.CLUI_Node_Box("back");
        //guiBack.rectScale = new CLUI_Border(0.1f, 0.1f, 0.9f, 0.9f);
        //back.AddNode(guiBack);

        //guiListBack = new CLUI_Node_Empty("listback");

        //var btn01 = new CLUI.CLUI_Node_Button("btn01");
        //btn01.rectScale = new CLUI_Border(0.1f, 0.1f, 0.5f, 0.2f);
        //btn01.text = "hello";
        //mgr.nodeUIRoot.AddNode(btn01);
        if (player == null)
        {
            player = new control.Player();
            player.SetInput(controller);
            player.PlayerState = new PlayerState();
            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName = "超级波动拳";
                cmd.DriveStyle = DriveStyle.BtnPressDrive;
                cmd.ClearCmd = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_BACK);//后
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN);//下
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT);//前
                cmd.padtag.Add((byte)PADTAG.PADKEY_BACK);//后
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN);//下
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT);//前
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);//拳
                player.PlayerState.listSkill.Add(cmd);
            }

            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName = "波动拳";
                cmd.DriveStyle = DriveStyle.BtnPressDrive;
                cmd.ClearCmd = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_BACK);//后
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN);//下
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT);//前
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);//拳
                player.PlayerState.listSkill.Add(cmd);
            }
            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName = "升龙拳";
                cmd.DriveStyle = DriveStyle.BtnPressDrive;
                cmd.ClearCmd = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT);//前
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN);//下
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT);//前
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);//拳
                player.PlayerState.listSkill.Add(cmd);
            }
            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName = "冲拳";
                cmd.DriveStyle = DriveStyle.BtnPressDrive;
                cmd.ClearCmd = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_RELEASE);//空
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT);//前
                cmd.padtag.Add((byte)PADTAG.PADKEY_RELEASE);//空
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT);//前
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);//拳
                player.PlayerState.listSkill.Add(cmd);
            }
            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName = "飞踢";
                cmd.DriveStyle = DriveStyle.BtnPressDrive;
                cmd.ClearCmd = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN);//下
                cmd.padtag.Add((byte)PADTAG.PADKEY_UP);//上
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);//脚
                player.PlayerState.listSkill.Add(cmd);
            }
        }

        //从磁盘加载
        #if UNITY_STANDALONE
        IList<string> packets= plist.InitPacketListLocal();
        foreach(var p in packets)
        {
            Debug.Log("got packet=" + p);
        }

        ResmgrNative.Instance.SetCacheUrl(plist.GetPackPathLocal());

        loadcurcount=3;
        ResmgrNative.Instance.LoadStringFromCache("base/skeleton.json.txt", "", onloadsk);
        ResmgrNative.Instance.LoadStringFromCache("base/cur.atlas.txt", "", onloadat);
        ResmgrNative.Instance.LoadTexture2DFromCache("base/cur.png", "", onloadatt);
        #endif
    }
Beispiel #2
0
    public void OnInit(IStateMgr mgr)
    {
        this.mgr = mgr;
        //var back = new CLUI.CLUI_Node_Box("_back");
        //back.rectScale = CLUI_Border.ScaleFill;
        //mgr.nodeUIRoot.AddNode(back);

        //guiBack = new CLUI.CLUI_Node_Box("back");
        //guiBack.rectScale = new CLUI_Border(0.1f, 0.1f, 0.9f, 0.9f);
        //back.AddNode(guiBack);

        //guiListBack = new CLUI_Node_Empty("listback");

        //var btn01 = new CLUI.CLUI_Node_Button("btn01");
        //btn01.rectScale = new CLUI_Border(0.1f, 0.1f, 0.5f, 0.2f);
        //btn01.text = "hello";
        //mgr.nodeUIRoot.AddNode(btn01);
        if (player == null)
        {
            player = new control.Player();
            player.SetInput(controller);
            player.PlayerState = new PlayerState();
            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName       = "超级波动拳";
                cmd.DriveStyle      = DriveStyle.BtnPressDrive;
                cmd.ClearCmd        = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_BACK);  //后
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN);  //下
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT); //前
                cmd.padtag.Add((byte)PADTAG.PADKEY_BACK);  //后
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN);  //下
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT); //前
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);    //拳
                player.PlayerState.listSkill.Add(cmd);
            }

            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName       = "波动拳";
                cmd.DriveStyle      = DriveStyle.BtnPressDrive;
                cmd.ClearCmd        = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_BACK);  //后
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN);  //下
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT); //前
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);    //拳
                player.PlayerState.listSkill.Add(cmd);
            }
            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName       = "升龙拳";
                cmd.DriveStyle      = DriveStyle.BtnPressDrive;
                cmd.ClearCmd        = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT); //前
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN);  //下
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT); //前
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);    //拳
                player.PlayerState.listSkill.Add(cmd);
            }
            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName       = "冲拳";
                cmd.DriveStyle      = DriveStyle.BtnPressDrive;
                cmd.ClearCmd        = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_RELEASE); //空
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT);   //前
                cmd.padtag.Add((byte)PADTAG.PADKEY_RELEASE); //空
                cmd.padtag.Add((byte)PADTAG.PADKEY_FRONT);   //前
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);      //拳
                player.PlayerState.listSkill.Add(cmd);
            }
            {
                SkillCmd cmd = new SkillCmd();
                cmd.SkillName       = "飞踢";
                cmd.DriveStyle      = DriveStyle.BtnPressDrive;
                cmd.ClearCmd        = true;
                cmd.BtnReleaseDrive = false;
                cmd.padtag.Add((byte)PADTAG.PADKEY_DOWN); //下
                cmd.padtag.Add((byte)PADTAG.PADKEY_UP);   //上
                cmd.btntag.Add((byte)KEYTAG.GAMEKEY_2);   //脚
                player.PlayerState.listSkill.Add(cmd);
            }
        }


        //从磁盘加载
#if UNITY_STANDALONE
        IList <string> packets = plist.InitPacketListLocal();
        foreach (var p in packets)
        {
            Debug.Log("got packet=" + p);
        }

        ResmgrNative.Instance.SetCacheUrl(plist.GetPackPathLocal());

        loadcurcount = 3;
        ResmgrNative.Instance.LoadStringFromCache("base/skeleton.json.txt", "", onloadsk);
        ResmgrNative.Instance.LoadStringFromCache("base/cur.atlas.txt", "", onloadat);
        ResmgrNative.Instance.LoadTexture2DFromCache("base/cur.png", "", onloadatt);
#endif
    }