Esempio n. 1
0
    void Start()
    {
        //设置默认参数
        weapon_list [DEFAULT_WEAPON] = true;
        head_list [DEFAULT_HEAD]     = true;
        chest_list [DEFAULT_CHEST]   = true;
        hand_list [DEFAULT_HAND]     = true;
        feet_list [DEFAULT_FEET]     = true;

        //创建合成角色 调整位置和角度
        //这里使用UCharacterMgr类用于管理所有合成角色 该类在本例中用处不大
        //核心过程就是实例化了一个UCharacterController(合成角色)对象
        //Prefab名需要遵守命名规则
        //如果需要使用这套系统直接实例化对象后添加到自己的玩家管理组件即可
        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);
        character.Instance.transform.position    = new Vector3(0, -1, -5);
        character.Instance.transform.eulerAngles = new Vector3(0, 180, 0);
    }
Esempio n. 2
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);
    }
Esempio n. 3
0
    void OnTriggerExit(Collider other)
    {
        if (other == null)
        {
            return;
        }

        if (charInstance == null)
        {
            charInstance = App.Game.character;
        }

        if (monControl == null)
        {
            monControl = this.transform.GetComponent <monsterAniControl>();
        }

        if (monControl.IsDie() == false)
        {
            if (monControl.IsInAttackState() == true)
            {
                monControl.setMonsterToStand();
            }
        }
    }
Esempio n. 4
0
    public UCharacterController Generatecharacter(string strPre)
    {
        UCharacterController instance = new UCharacterController(strPre);

        characterDic = instance;
        return(instance);
    }
Esempio n. 5
0
    // Use this for initialization
    IEnumerator Start()
    {
        // for GUI display
        weapon_list [DEFAULT_WEAPON] = true;
        head_list [DEFAULT_HEAD]     = true;
        chest_list [DEFAULT_CHEST]   = true;
        hand_list [DEFAULT_HAND]     = true;
        feet_list [DEFAULT_FEET]     = true;

        // 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);
        character.Instance.transform.position    = new Vector3(0, -1, -5);
        character.Instance.transform.eulerAngles = new Vector3(0, 180, 0);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(1f));

        character.ChangeChestEquipment("ch_pc_hou_" + index[0] + "_shen", combine);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(0.5f));

        character.ChangeChestEquipment("ch_pc_hou_" + index[1] + "_shen", combine);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(0.5f));

        character.ChangeChestEquipment("ch_pc_hou_" + index[2] + "_shen", combine);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(0.5f));

        character.ChangeHandEquipment("ch_pc_hou_" + index[0] + "_shou", combine);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(0.5f));

        character.ChangeHandEquipment("ch_pc_hou_" + index[1] + "_shou", combine);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(0.5f));

        character.ChangeHandEquipment("ch_pc_hou_" + index[2] + "_shou", combine);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(0.5f));

        character.ChangeWeapon("ch_we_one_hou_" + index[0]);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(0.5f));

        character.ChangeWeapon("ch_we_one_hou_" + index[1]);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(0.5f));

        character.ChangeWeapon("ch_we_one_hou_" + index[2]);
        Debug.Log(Time.frameCount);
        yield return(new WaitForSeconds(0.5f));
    }
Esempio n. 6
0
 public void roleClear()
 {
     if (character != null)
     {
         App.Game.CharacterMgr.RemoveChar();
         character = null;
     }
 }
Esempio n. 7
0
    public UCharacterController Generatecharacter(string skeleton, string weapon, string head, string chest, string hand, string feet, bool combine = false)
    {
        UCharacterController instance = new UCharacterController (characterIndex,skeleton,weapon,head,chest,hand,feet,combine);
        characterDic.Add(characterIndex,instance);
        characterIndex ++;

        return instance;
    }
Esempio n. 8
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="skeleton">共用的骨骼prefab名</param>
    /// <param name="weapon"></param>
    /// <param name="head"></param>
    /// <param name="chest"></param>
    /// <param name="hand"></param>
    /// <param name="feet"></param>
    /// <param name="combine"></param>
    /// <returns></returns>
    public UCharacterController Generatecharacter(string skeleton, string weapon, string head, string chest, string hand, string feet, bool combine = false)
    {
        UCharacterController instance = new UCharacterController(characterIndex, skeleton, weapon, head, chest, hand, feet, combine);

        characterDic.Add(characterIndex, instance);
        characterIndex++;

        return(instance);
    }
Esempio n. 9
0
    private void changeRole()
    {
        Vector3 tmpPos = character.roleInstance.transform.position;
        Vector3 nowPos = new Vector3(tmpPos.x, 0.0f, tmpPos.z);

        if (character != null)
        {
            App.Game.CharacterMgr.changeChar();
            character = null;
        }

        createRole(nowPos, roleID);
    }
Esempio n. 10
0
    void Start()
    {
        //roleInstance = null;
        //   Debug.LogWarning("attackCollider start");
        if (charInstance == null)
        {
            charInstance = App.Game.character;
        }

        if (charInstance != null)
        {
            if (pAttackClass == null)
            {
                pAttackClass = charInstance.roleInstance.GetComponent <attcakStartEnd>();
            }
        }
    }
Esempio n. 11
0
    // Use this for initialization
    void Start()
    {
        // for GUI display
        weapon_list [DEFAULT_WEAPON] = true;
        head_list [DEFAULT_HEAD]     = true;
        chest_list [DEFAULT_CHEST]   = true;
        hand_list [DEFAULT_HAND]     = true;
        feet_list [DEFAULT_FEET]     = true;

        // 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);
        character.Instance.transform.position    = new Vector3(0, -1, -5);
        character.Instance.transform.eulerAngles = new Vector3(0, 180, 0);
    }
Esempio n. 12
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;
    }
Esempio n. 13
0
 public void clearRole()
 {
     // GameObject.Destroy(character);
     character = null;
 }
Esempio n. 14
0
    // Use this for initialization
    void Start()
    {
        // for GUI display
        weapon_list [DEFAULT_WEAPON] = true;
        head_list [DEFAULT_HEAD] = true;
        chest_list [DEFAULT_CHEST] = true;
        hand_list [DEFAULT_HAND] = true;
        feet_list [DEFAULT_FEET] = true;

        // 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);
        character.Instance.transform.position = new Vector3 (0, -1, -5);
        character.Instance.transform.eulerAngles = new Vector3 (0, 180, 0);
    }
Esempio n. 15
0
 public void RemoveChar()
 {
     characterDic.dataDestory();
     characterDic = null;
 }
Esempio n. 16
0
 /*
  *  public UCharacterController Generatecharacter (string skeleton, string weapon, string head, string chest, string hand, string feet, bool combine = false)
  *  {
  *
  *  UCharacterController instance = new UCharacterController (characterIndex,skeleton,weapon,head,chest,hand,feet,combine);
  *  characterDic = instance;
  *  //characterDic.Add(characterIndex,instance);
  *          //characterIndex ++;
  *
  *          return instance;
  *  }
  */
 public void changeChar()
 {
     characterDic.onlyRoleDestory();
     characterDic = null;
 }