Exemple #1
0
        }                                      // 存储商店售卖哪些道具

        public GameData()
        {
            //构造函数,设置默认存档
            key = SystemInfo.deviceUniqueIdentifier;    //设定密钥,根据具体平台设定//
            // Player
            Name = "我";
            Rank = 1;
            Gold = 100;

            // 【以后需要删掉】
            CanAvoid   = true;
            CanAttack2 = true;
            CanAttack3 = true;
            CanDush    = true;
            // 【以后需要删掉】

            // 初始装备
            Fit = new IEquip[6];
            Fit[(int)FitType.Weapon] = UnityHelper.FindDic(GameMainProgram.Instance.dataBaseMgr.dicEquip, "太刀");
            // 初始背包,1~31值为-1
            PropNum = new int[32];
            for (int i = 1; i < 32; i++)
            {
                PropNum[i] = -1;
            }
            PropNum[0] = 3;
            MedicineID = 0;
            // 其他
            HasProp    = new bool[32];
            HasProp[0] = true;
            HasProp[1] = true;
        }
 public GameData()
 {
     // 构造函数,设置默认存档
     key = SystemInfo.deviceUniqueIdentifier;    // 设定密钥,根据具体平台设定
     HP  = 100;
     // Player
     Fit = UnityHelper.FindDic(GameMainProgram.Instance.dataBaseMgr.equipDict, "步枪");
 }
Exemple #3
0
 /// <summary>
 /// 显示文本信息
 /// </summary>
 /// <param name="stringId">文本的ID</param>
 /// <returns></returns>
 public string ShowText(string stringId)
 {
     if (SettingSaveData.IsChinese)
     {
         return(UnityHelper.FindDic(languageCN_Dict, stringId));
     }
     else
     {
         return(UnityHelper.FindDic(languageEN_Dict, stringId));
     }
 }
Exemple #4
0
        public void StartDialog(string key, UnityAction dialogCompleteAction = null)
        {
            List <string> talks = UnityHelper.FindDic(talksDict, key);

            if (talks == null || talks.Count == 0)
            {
                Debug.LogError("对话内容为空");
                return;
            }
            UIDialog.StartDialog(talks, dialogCompleteAction);
        }
Exemple #5
0
        /// <summary>
        /// 在预制的位置生成NPC的Prefab
        /// </summary>
        /// <param name="npcName"></param>
        public void CreateNpc(string npcName)
        {
            if (string.IsNullOrEmpty(npcName))
            {
                return;
            }
            GameObject go  = gameMain.resourcesMgr.LoadAsset(UnityHelper.FindDic(dicNpcPaths, npcName));
            INPC       npc = null;

            if (go)
            {
                npc = go.GetComponent <INPC>();
            }
            if (npc != null)
            {
                npcInScene.Add(npc);
                npc.Initialize();
            }
            else
            {
                Debug.LogError("Npc==null");
            }
        }
Exemple #6
0
        public GameData()
        {
            //构造函数,设置默认存档
            key = SystemInfo.deviceUniqueIdentifier;    //设定密钥,根据具体平台设定//
            // Player
            Name = "我";
            Rank = 1;
            Gold = 100;

            CanAttack = true;
            // 初始装备
            Fit = new IEquip[6];
            Fit[(int)FitType.Weapon] = UnityHelper.FindDic(GameMainProgram.Instance.dataBaseMgr.equipDict, "太刀");
            // 初始背包,1~31值为-1
            PropNum = new int[32];
            for (int i = 1; i < 32; i++)
            {
                PropNum[i] = -1;
            }
            PropNum[0] = 3;
            // 其他
            TasksData = new List <TaskData>();
        }
Exemple #7
0
 public GameData()
 {
     //构造函数,设置默认存档
     key = SystemInfo.deviceUniqueIdentifier;    //设定密钥,根据具体平台设定//
     // Player
     Name = "Yuka";
     Rank = 1;
     Gold = 100;
     // 初始背包
     EquipPack    = new IEquip[35];
     PropPack     = new IProp[35];
     EquipPack[0] = UnityHelper.FindDic(GameMainProgram.Instance.dataBaseMgr.dicWeapon, "太刀");
     EquipPack[1] = UnityHelper.FindDic(GameMainProgram.Instance.dataBaseMgr.dicCloth, "学生服");
     EquipPack[2] = UnityHelper.FindDic(GameMainProgram.Instance.dataBaseMgr.dicShoe, "学生鞋");
     PropPack[0]  = UnityHelper.FindDic(GameMainProgram.Instance.dataBaseMgr.dicMedicine, "回复药");
     // 初始装备
     Fit = new int[8] {
         99, 99, 99, 99, 99, 99, 99, 99
     };                                                   // 初始值>34表示未装备
     Fit[(int)FitType.Weapon]   = 0;
     Fit[(int)FitType.Cloth]    = 1;
     Fit[(int)FitType.Shoe]     = 2;
     Fit[(int)FitType.Medicine] = 0;
 }
Exemple #8
0
 /// <summary>
 /// 到显示文本信息
 /// </summary>
 /// <param name="lauguageID">语言的ID</param>
 /// <returns></returns>
 public string ShowText(string stringID)
 {
     return(UnityHelper.FindDic(dicLauguageCache, stringID));
 }