Exemple #1
0
 /// <summary>
 /// 设置背景
 /// </summary>
 /// <param name="npcType"></param>
 public void SetBackground(NpcTypeEnum npcType)
 {
     if (ivCardBG == null || ivHaloBG == null)
     {
         return;
     }
     if (npcType == NpcTypeEnum.RecruitRare)
     {
         ivCardBG.sprite = spBGRare;
         ivHaloBG.color  = colorForRare;
         tvName.color    = colorForRare;
     }
     else
     {
         ivCardBG.sprite = spBGNormal;
         ivHaloBG.color  = colorForNormal;
         tvName.color    = colorForNormal;
     }
 }
    /// <summary>
    /// Npc Item
    /// </summary>
    public static void GUINpcInfoItem(GameObject objNpcContainer, NpcInfoBean npcInfo)
    {
        if (GUILayout.Button("获取场景位置数据", GUILayout.Width(120), GUILayout.Height(20)))
        {
            BaseNpcAI npcAI = objNpcContainer.GetComponentInChildren <BaseNpcAI>();
            npcInfo.position_x = npcAI.transform.position.x;
            npcInfo.position_y = npcAI.transform.position.y;
        }
        GUILayout.Label("NPCID:", GUILayout.Width(100), GUILayout.Height(20));
        npcInfo.id     = long.Parse(EditorGUILayout.TextArea(npcInfo.id + "", GUILayout.Width(100), GUILayout.Height(20)));
        npcInfo.npc_id = npcInfo.id;
        GUILayout.BeginHorizontal();
        npcInfo.npc_type = (int)EditorUI.GUIEnum <NpcTypeEnum>("Npc类型:", npcInfo.npc_type);
        NpcTypeEnum npcType = (NpcTypeEnum)npcInfo.npc_type;

        GUILayout.Label("对话选项:", GUILayout.Width(100), GUILayout.Height(20));
        npcInfo.talk_types = EditorUI.GUIEditorText(npcInfo.talk_types, 50);
        GUILayout.EndHorizontal();
        if (npcType != NpcTypeEnum.Passerby)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("姓名:", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.name = EditorGUILayout.TextArea(npcInfo.name + "", GUILayout.Width(100), GUILayout.Height(20));
            GUILayout.Label("性别:1男 2女", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.sex = int.Parse(EditorGUILayout.TextArea(npcInfo.sex + "", GUILayout.Width(30), GUILayout.Height(20)));
            GUILayout.Label("称号:", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.title_name = EditorGUILayout.TextArea(npcInfo.title_name + "", GUILayout.Width(100), GUILayout.Height(20));
            GUILayout.Label("朝向 1左 2右", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.face = int.Parse(EditorGUILayout.TextArea(npcInfo.face + "", GUILayout.Width(30), GUILayout.Height(20)));
            GUILayout.Label("位置XY:", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.position_x = float.Parse(EditorGUILayout.TextArea(npcInfo.position_x + "", GUILayout.Width(100), GUILayout.Height(20)));
            npcInfo.position_y = float.Parse(EditorGUILayout.TextArea(npcInfo.position_y + "", GUILayout.Width(100), GUILayout.Height(20)));
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();

            GUILayout.Label("眼睛:", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.eye_id = EditorGUILayout.TextArea(npcInfo.eye_id + "", GUILayout.Width(200), GUILayout.Height(20));
            string eyePath = "Assets/Texture/Character/Eye/";
            EditorUI.GUIPic(eyePath, npcInfo.eye_id);
            GUILayout.Label("眼睛颜色:", GUILayout.Width(100), GUILayout.Height(20));
            ColorBean eyeColorData = new ColorBean(npcInfo.eye_color);
            Color     eyeColor     = eyeColorData.GetColor();;
            eyeColor          = EditorGUILayout.ColorField(eyeColor, GUILayout.Width(50), GUILayout.Height(20));
            npcInfo.eye_color = eyeColor.r + "," + eyeColor.g + "," + eyeColor.b + "," + eyeColor.a;

            GUILayout.Label("嘴巴:", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.mouth_id = EditorGUILayout.TextArea(npcInfo.mouth_id + "", GUILayout.Width(200), GUILayout.Height(20));
            string mouthPath = "Assets/Texture/Character/Mouth/";
            EditorUI.GUIPic(mouthPath, npcInfo.mouth_id);
            GUILayout.Label("嘴巴颜色:", GUILayout.Width(100), GUILayout.Height(20));
            ColorBean mouthColorData = new ColorBean(npcInfo.mouth_color);
            Color     mouthColor     = mouthColorData.GetColor();;
            mouthColor          = EditorGUILayout.ColorField(mouthColor, GUILayout.Width(50), GUILayout.Height(20));
            npcInfo.mouth_color = mouthColor.r + "," + mouthColor.g + "," + mouthColor.b + "," + mouthColor.a;

            GUILayout.Label("头发:", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.hair_id = EditorGUILayout.TextArea(npcInfo.hair_id + "", GUILayout.Width(200), GUILayout.Height(20));
            string hairPath = "Assets/Texture/Character/Hair/";
            EditorUI.GUIPic(hairPath, npcInfo.hair_id);
            GUILayout.Label("头发颜色:", GUILayout.Width(100), GUILayout.Height(20));
            ColorBean hairColorData = new ColorBean(npcInfo.hair_color);
            Color     hairColor     = hairColorData.GetColor();;
            hairColor          = EditorGUILayout.ColorField(hairColor, GUILayout.Width(50), GUILayout.Height(20));
            npcInfo.hair_color = hairColor.r + "," + hairColor.g + "," + hairColor.b + "," + hairColor.a;

            GUILayout.Label("皮肤颜色:", GUILayout.Width(100), GUILayout.Height(20));
            ColorBean skinColorData = new ColorBean(npcInfo.skin_color);
            Color     skinColor     = skinColorData.GetColor();;
            skinColor          = EditorGUILayout.ColorField(skinColor, GUILayout.Width(50), GUILayout.Height(20));
            npcInfo.skin_color = skinColor.r + "," + skinColor.g + "," + skinColor.b + "," + skinColor.a;

            GUILayout.EndHorizontal();


            GUILayout.BeginHorizontal();

            GUILayout.Label("命:", GUILayout.Width(30), GUILayout.Height(20));
            npcInfo.attributes_life = int.Parse(EditorGUILayout.TextArea(npcInfo.attributes_life + "", GUILayout.Width(50), GUILayout.Height(20)));
            GUILayout.Label("厨:", GUILayout.Width(30), GUILayout.Height(20));
            npcInfo.attributes_cook = int.Parse(EditorGUILayout.TextArea(npcInfo.attributes_cook + "", GUILayout.Width(50), GUILayout.Height(20)));
            GUILayout.Label("速:", GUILayout.Width(30), GUILayout.Height(20));
            npcInfo.attributes_speed = int.Parse(EditorGUILayout.TextArea(npcInfo.attributes_speed + "", GUILayout.Width(50), GUILayout.Height(20)));
            GUILayout.Label("算:", GUILayout.Width(30), GUILayout.Height(20));
            npcInfo.attributes_account = int.Parse(EditorGUILayout.TextArea(npcInfo.attributes_account + "", GUILayout.Width(50), GUILayout.Height(20)));
            GUILayout.Label("魅:", GUILayout.Width(30), GUILayout.Height(20));
            npcInfo.attributes_charm = int.Parse(EditorGUILayout.TextArea(npcInfo.attributes_charm + "", GUILayout.Width(50), GUILayout.Height(20)));
            GUILayout.Label("武:", GUILayout.Width(30), GUILayout.Height(20));
            npcInfo.attributes_force = int.Parse(EditorGUILayout.TextArea(npcInfo.attributes_force + "", GUILayout.Width(50), GUILayout.Height(20)));
            GUILayout.Label("运:", GUILayout.Width(30), GUILayout.Height(20));
            npcInfo.attributes_lucky = int.Parse(EditorGUILayout.TextArea(npcInfo.attributes_lucky + "", GUILayout.Width(50), GUILayout.Height(20)));
            if (npcType == NpcTypeEnum.RecruitTown)
            {
                GUILayout.Label("忠诚:", GUILayout.Width(30), GUILayout.Height(20));
                npcInfo.attributes_loyal = int.Parse(EditorGUILayout.TextArea(npcInfo.attributes_loyal + "", GUILayout.Width(50), GUILayout.Height(20)));
                GUILayout.Label("工资 S:", GUILayout.Width(30), GUILayout.Height(20));
                npcInfo.wage_s = int.Parse(EditorGUILayout.TextArea(npcInfo.wage_s + "", GUILayout.Width(50), GUILayout.Height(20)));
            }
            GUILayout.Label("喜欢的东西ID(用,分隔):", GUILayout.Width(150), GUILayout.Height(20));
            npcInfo.love_items = EditorGUILayout.TextArea(npcInfo.love_items + "", GUILayout.Width(100), GUILayout.Height(20));
            GUILayout.Label("喜欢的菜品:", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.love_menus = EditorGUILayout.TextArea(npcInfo.love_menus + "", GUILayout.Width(50), GUILayout.Height(20));
            GUILayout.Label("技能:", GUILayout.Width(100), GUILayout.Height(20));
            npcInfo.skill_ids = EditorUI.GUIEditorText(npcInfo.skill_ids, 100);
            GUILayout.EndHorizontal();
        }
        GUILayout.BeginHorizontal();
        EditorUI.GUIText("|", 10);
        EditorUI.GUIText("面具:", 50);
        npcInfo.mask_id = long.Parse(EditorGUILayout.TextArea(npcInfo.mask_id + "", GUILayout.Width(100), GUILayout.Height(20)));
        string        maskPath = "Assets/Texture/Character/Dress/Mask/";
        ItemsInfoBean maskInfo = GameItemsHandler.Instance.manager.GetItemsById(npcInfo.mask_id);

        if (maskInfo != null)
        {
            EditorUI.GUIPic(maskPath, maskInfo.icon_key);
        }
        EditorUI.GUIText("|", 10);
        EditorUI.GUIText("帽子:", 50);
        npcInfo.hat_id = long.Parse(EditorGUILayout.TextArea(npcInfo.hat_id + "", GUILayout.Width(100), GUILayout.Height(20)));
        string        hatPath = "Assets/Texture/Character/Dress/Hat/";
        ItemsInfoBean hatInfo = GameItemsHandler.Instance.manager.GetItemsById(npcInfo.hat_id);

        if (hatInfo != null)
        {
            EditorUI.GUIPic(hatPath, hatInfo.icon_key);
        }
        EditorUI.GUIText("|", 10);
        EditorUI.GUIText("衣服:", 50);
        npcInfo.clothes_id = long.Parse(EditorGUILayout.TextArea(npcInfo.clothes_id + "", GUILayout.Width(100), GUILayout.Height(20)));
        string        clothesPath = "Assets/Texture/Character/Dress/Clothes/";
        ItemsInfoBean clothesInfo = GameItemsHandler.Instance.manager.GetItemsById(npcInfo.clothes_id);

        if (clothesInfo != null)
        {
            EditorUI.GUIPic(clothesPath, clothesInfo.icon_key);
        }
        EditorUI.GUIText("|", 10);
        EditorUI.GUIText("鞋子:", 50);
        npcInfo.shoes_id = long.Parse(EditorGUILayout.TextArea(npcInfo.shoes_id + "", GUILayout.Width(100), GUILayout.Height(20)));
        string        shoesPath = "Assets/Texture/Character/Dress/Shoes/";
        ItemsInfoBean shoesInfo = GameItemsHandler.Instance.manager.GetItemsById(npcInfo.shoes_id);

        if (shoesInfo != null)
        {
            EditorUI.GUIPic(shoesPath, shoesInfo.icon_key);
        }
        EditorUI.GUIText("|", 10);
        EditorUI.GUIText("武器:", 50);
        npcInfo.hand_id = long.Parse(EditorGUILayout.TextArea(npcInfo.hand_id + "", GUILayout.Width(100), GUILayout.Height(20)));
        ItemsInfoBean handInfo = GameItemsHandler.Instance.manager.GetItemsById(npcInfo.hand_id);

        if (handInfo != null)
        {
            EditorUI.GUIText(handInfo.name, 50);
        }

        EditorUI.GUIText("|", 10);
        GUILayout.EndHorizontal();
        npcInfo.condition = EditorUI.GUIListData <ShowConditionEnum>("Npc出现条件", npcInfo.condition);
    }
Exemple #3
0
 public List <CharacterBean> GetCharacterDataByType(NpcTypeEnum type)
 {
     return(GetCharacterDataByType(new int[] { (int)type }));
 }