Esempio n. 1
0
        private void LoadLevels()
        {
            SettingReader.Load("Levels", (l, i) =>
            {
                string name     = l.GetString(i, "Name");
                string nikeName = l.GetString(i, "NikeName");

                LevelsInfo.Add(name, nikeName);
            });
        }
Esempio n. 2
0
        private void LoadDiaries()
        {
            SettingReader.Load("DiariesText", (l, i) =>
            {
                int id   = l.GetInteger(i, "Id");
                string t = l.GetString(i, "Text");

                DocsDesc.Add(id, t);
            });
        }
Esempio n. 3
0
        public void CreateLevelItem()
        {
            // 创建日志的道具
            string fileName = LevelName;

            // 根据类型,创建不同的对象
            SettingReader.Load(fileName, (l, i) =>
            {
                string path = l.GetString(i, "Prefab");
                float x     = l.GetFloat(i, "PosX");
                float y     = l.GetFloat(i, "PosY");
                string name = l.GetString(i, "Name");

                var o     = Resources.Load(path) as GameObject;
                var item  = Instantiate(o) as GameObject;
                item.name = name;
                item.transform.position = new Vector3(x, y, 0);
                item.transform.rotation = Quaternion.identity;
            });
        }