Esempio n. 1
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. 2
0
    void OnGUI()
    {
        GUI.Button(new Rect(0, 0, 100, 30), "Euipments 1");
        GUI.Button(new Rect(100, 0, 100, 30), "Euipments 2");
        GUI.Button(new Rect(200, 0, 100, 30), "Euipments 3");

        for (int i = 0; i < weapon_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * 100, 30, 100, 50), "Weapon" + (weapon_list[i] ? "(√)" : "")))
            {
                if (!weapon_list [i])
                {
                    for (int j = 0; j < weapon_list.Length; j++)
                    {
                        weapon_list [j] = false;
                    }
                    weapon_list [i] = true;

                    character.ChangeWeapon("ch_we_one_hou_" + index[i]);
                }
            }
        }

        for (int i = 0; i < head_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * 100, 80, 100, 50), "Head" + (head_list[i] ? "(√)" : "")))
            {
                if (!head_list [i])
                {
                    for (int j = 0; j < head_list.Length; j++)
                    {
                        head_list [j] = false;
                    }
                    head_list [i] = true;

                    character.ChangeHeadEquipment("ch_pc_hou_" + index[i] + "_tou", combine);
                }
            }
        }

        for (int i = 0; i < chest_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * 100, 130, 100, 50), "Chest" + (chest_list[i] ? "(√)" : "")))
            {
                if (!chest_list [i])
                {
                    for (int j = 0; j < chest_list.Length; j++)
                    {
                        chest_list [j] = false;
                    }
                    chest_list [i] = true;

                    character.ChangeChestEquipment("ch_pc_hou_" + index[i] + "_shen", combine);
                }
            }
        }

        for (int i = 0; i < hand_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * 100, 180, 100, 50), "Hand" + (hand_list[i] ? "(√)" : "")))
            {
                if (!hand_list [i])
                {
                    for (int j = 0; j < hand_list.Length; j++)
                    {
                        hand_list [j] = false;
                    }
                    hand_list [i] = true;

                    character.ChangeHandEquipment("ch_pc_hou_" + index[i] + "_shou", combine);
                }
            }
        }

        for (int i = 0; i < feet_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * 100, 230, 100, 50), "Feet" + (feet_list[i] ? "(√)" : "")))
            {
                if (!feet_list [i])
                {
                    for (int j = 0; j < feet_list.Length; j++)
                    {
                        feet_list [j] = false;
                    }
                    feet_list [i] = true;

                    character.ChangeFeetEquipment("ch_pc_hou_" + index[i] + "_jiao", combine);
                }
            }
        }

        if (GUI.Button(new Rect(Screen.width - 100, 0, 100, 50), character.animationState == 0 ? "Attack" : "Stand"))
        {
            if (character.animationState == 0)
            {
                character.PlayAttack();
            }
            else
            {
                character.PlayStand();
            }
        }

        if (GUI.Button(new Rect(Screen.width - 100, 50, 100, 50), character.rotate ? "Static" : "Rotate"))
        {
            if (character.rotate)
            {
                character.rotate = false;
            }
            else
            {
                character.rotate = true;
            }
        }

        if (GUI.Button(new Rect(Screen.width - 150, 100, 150, 50), combine ? "Merge materials(√)" : "Merge materials"))
        {
            combine = !combine;
        }
    }
Esempio n. 3
0
    void OnGUI()
    {
        float btnWidth  = 100.0f;
        float btnHeight = 100.0f;
        float btnPosY   = btnHeight + 5.0f;


        GUI.Button(new Rect(0, 0, btnWidth, btnHeight), "Euipments 1");
        GUI.Button(new Rect(btnWidth, 0, btnWidth, btnHeight), "Euipments 2");
        GUI.Button(new Rect(btnWidth * 2, 0, btnWidth, btnHeight), "Euipments 3");


        for (int i = 0; i < weapon_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY, btnWidth, btnHeight), "武器" + (weapon_list[i] ? "(√)" : "")))
            {
                if (!weapon_list [i])
                {
                    for (int j = 0; j < weapon_list.Length; j++)
                    {
                        weapon_list [j] = false;
                    }
                    weapon_list [i] = true;

                    character.ChangeWeapon("ch_we_one_hou_" + index[i]);
                }
            }
        }

        for (int i = 0; i < head_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY * 2, btnWidth, btnHeight), "头" + (head_list[i] ? "(√)" : "")))
            {
                if (!head_list [i])
                {
                    for (int j = 0; j < head_list.Length; j++)
                    {
                        head_list [j] = false;
                    }
                    head_list [i] = true;

                    character.ChangeHeadEquipment("ch_pc_hou_" + index[i] + "_tou", combine);
                }
            }
        }

        for (int i = 0; i < chest_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY * 3, btnWidth, btnHeight), "身体" + (chest_list[i] ? "(√)" : "")))
            {
                if (!chest_list [i])
                {
                    for (int j = 0; j < chest_list.Length; j++)
                    {
                        chest_list [j] = false;
                    }
                    chest_list [i] = true;

                    character.ChangeChestEquipment("ch_pc_hou_" + index[i] + "_shen", combine);
                }
            }
        }

        for (int i = 0; i < hand_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY * 4, btnWidth, btnHeight), "手" + (hand_list[i] ? "(√)" : "")))
            {
                if (!hand_list [i])
                {
                    for (int j = 0; j < hand_list.Length; j++)
                    {
                        hand_list [j] = false;
                    }
                    hand_list [i] = true;

                    character.ChangeHandEquipment("ch_pc_hou_" + index[i] + "_shou", combine);
                }
            }
        }

        for (int i = 0; i < feet_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY * 5, btnWidth, btnHeight), "腿" + (feet_list[i] ? "(√)" : "")))
            {
                if (!feet_list [i])
                {
                    for (int j = 0; j < feet_list.Length; j++)
                    {
                        feet_list [j] = false;
                    }
                    feet_list [i] = true;

                    character.ChangeFeetEquipment("ch_pc_hou_" + index[i] + "_jiao", combine);
                }
            }
        }


        if (GUI.Button(new Rect(Screen.width - btnWidth, 0, btnWidth, btnHeight), "getState"))
        {
            App.Game.character.mainRoleState.printRoleState();
        }

        if (GUI.Button(new Rect(Screen.width - btnWidth, btnPosY, btnWidth, btnHeight), "镜头复原"))
        {
            App.Game.character.rolePosCamer.resetCamerPosFromRole();
        }

        if (GUI.Button(new Rect(Screen.width - btnWidth, btnPosY * 2, btnWidth, btnHeight), "Escape"))
        {
            /*
             * Generator3D tmpMaze = this.gameObject.transform.GetComponent<Generator3D>();
             * if (tmpMaze != null)
             *  createRole(tmpMaze.firstPos);
             * else
             *  createRole(new Vector3(5, 0.005f, -5));
             */

            //App.Game.character.rolePosCamer.test();
            App.Game.character.setRoleInEscape();
            StartCoroutine(escapeIEn());
        }

        if (GUI.Button(new Rect(Screen.width - btnWidth, btnPosY * 3, btnWidth, btnHeight), "rolationCamerY"))
        {
            // App.Game.character.test();
            App.Game.character.rolePosCamer.rolationCamerY(90.0f, 1.0f / 40.0f);
            //App.Game.character.rolePosCamer.test(0, 3.0f);
        }
    }
Esempio n. 4
0
    /// <summary>
    /// UI调试
    /// </summary>
    /// <param name="obj"></param>

#if DEBUG_role
    void OnGUI()
    {
        float btnWidth  = 100.0f;
        float btnHeight = 100.0f;
        float btnPosY   = btnHeight + 5.0f;


        GUI.Button(new Rect(0, 0, btnWidth, btnHeight), "Euipments 1");
        GUI.Button(new Rect(btnWidth, 0, btnWidth, btnHeight), "Euipments 2");
        GUI.Button(new Rect(btnWidth * 2, 0, btnWidth, btnHeight), "Euipments 3");


        for (int i = 0; i < weapon_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY, btnWidth, btnHeight), "武器" + (weapon_list[i] ? "(√)" : "")))
            {
                if (!weapon_list [i])
                {
                    for (int j = 0; j < weapon_list.Length; j++)
                    {
                        weapon_list [j] = false;
                    }
                    weapon_list [i] = true;

                    character.ChangeWeapon("ch_we_one_hou_" + index[i]);
                }
            }
        }

        for (int i = 0; i < head_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY * 2, btnWidth, btnHeight), "头" + (head_list[i] ? "(√)" : "")))
            {
                if (!head_list [i])
                {
                    for (int j = 0; j < head_list.Length; j++)
                    {
                        head_list [j] = false;
                    }
                    head_list [i] = true;

                    character.ChangeHeadEquipment("ch_pc_hou_" + index[i] + "_tou", combine);
                }
            }
        }

        for (int i = 0; i < chest_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY * 3, btnWidth, btnHeight), "身体" + (chest_list[i] ? "(√)" : "")))
            {
                if (!chest_list [i])
                {
                    for (int j = 0; j < chest_list.Length; j++)
                    {
                        chest_list [j] = false;
                    }
                    chest_list [i] = true;

                    character.ChangeChestEquipment("ch_pc_hou_" + index[i] + "_shen", combine);
                }
            }
        }

        for (int i = 0; i < hand_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY * 4, btnWidth, btnHeight), "手" + (hand_list[i] ? "(√)" : "")))
            {
                if (!hand_list [i])
                {
                    for (int j = 0; j < hand_list.Length; j++)
                    {
                        hand_list [j] = false;
                    }
                    hand_list [i] = true;

                    character.ChangeHandEquipment("ch_pc_hou_" + index[i] + "_shou", combine);
                }
            }
        }

        for (int i = 0; i < feet_list.Length; i++)
        {
            if (GUI.Button(new Rect(i * btnWidth, btnPosY * 5, btnWidth, btnHeight), "腿" + (feet_list[i] ? "(√)" : "")))
            {
                if (!feet_list [i])
                {
                    for (int j = 0; j < feet_list.Length; j++)
                    {
                        feet_list [j] = false;
                    }
                    feet_list [i] = true;

                    character.ChangeFeetEquipment("ch_pc_hou_" + index[i] + "_jiao", combine);
                }
            }
        }
    }