Beispiel #1
0
    public void createRole(Vector3 pPos)
    {
        // create an avatar
        character = App.Game.CharacterMgr.Generatecharacter(
            "ch_pc_hou",
            "ch_we_one_hou_" + index[DEFAULT_WEAPON],
            "ch_pc_hou_" + index[DEFAULT_HEAD] + "_tou",
            "ch_pc_hou_" + index[DEFAULT_CHEST] + "_shen",
            "ch_pc_hou_" + index[DEFAULT_HAND] + "_shou",
            "ch_pc_hou_" + index[DEFAULT_FEET] + "_jiao",
            combine);

        App.Game.gameManager = this.gameManager;
        // App.Game.character = this.character;

        character.roleInstance.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);

        character.initData(cameraTransform, character.roleInstance.transform, pPos, roleCanvas);

        isStart = true;

        //   App.Game.character.rolePosCamer.setCameraAndTrans(cameraTransform, character.roleInstance.transform);

        //App.Game.character.roleInstance = App.Game.character.roleChangeColorWeaponMgr.roleInstance;
        //App.Game.CharacterMgr

        // AvaterAnimationController tmpAnimaCon = character.roleInstance.GetComponent<AvaterAnimationController>();
        // tmpAnimaCon.setCamera(cameraTransform, gameManager);
    }
Beispiel #2
0
    //创建主角
    public void createRole(Vector3 pPos, int pRoleID = 0)
    {
        /*
         * character = App.Game.CharacterMgr.Generatecharacter(
         *  "ch_pc_hou",
         *  "ch_we_one_hou_" + index[DEFAULT_WEAPON],
         *  "ch_pc_hou_" + index[DEFAULT_HEAD] + "_tou",
         *  "ch_pc_hou_" + index[DEFAULT_CHEST] + "_shen",
         *  "ch_pc_hou_" + index[DEFAULT_HAND] + "_shou",
         *  "ch_pc_hou_" + index[DEFAULT_FEET] + "_jiao",
         *  combine);
         */
        roleID = pRoleID;
        string strPre = RoleInfoTable.GetPrefab(roleID);

        character = App.Game.CharacterMgr.Generatecharacter(strPre);
        addRoleData(character.roleInstance, roleID);

        character.initData(cameraTransform, character.roleInstance.transform, pPos, roleCanvas, mapCamerTransform, monParentTransform);
        isStart = true;
    }