Ejemplo n.º 1
0
        public void InitEditorData(int instanceIndex)
        {
            if (this.GameDesignerEditorProfile == null)
            {
                var GameDesignerEditorProfiles = AssetFinder.SafeAssetFind <GameDesignerEditorProfile>("t:" + typeof(GameDesignerEditorProfile).Name);
                foreach (var GameDesignerEditorProfile in GameDesignerEditorProfiles)
                {
                    if (GameDesignerEditorProfile.GameDesignerProfileInstanceIndex == instanceIndex)
                    {
                        this.GameDesignerEditorProfile = GameDesignerEditorProfile;
                        break;
                    }
                }

                if (this.GameDesignerEditorProfile == null)
                {
                    var CreatedGameDesignerEditorProfile = (GameDesignerEditorProfile)GameDesignerEditorProfile.CreateInstance(typeof(GameDesignerEditorProfile));
                    CreatedGameDesignerEditorProfile.GameDesignerProfileInstanceIndex = instanceIndex;
                    AssetDatabase.CreateAsset(CreatedGameDesignerEditorProfile, GameDesignerProfilePath + "/GameDesignerEditorProfile_" + instanceIndex + ".asset");
                    this.GameDesignerEditorProfile = CreatedGameDesignerEditorProfile;
                }
            }
            if (this.GameDesignerEditorProfile != null)
            {
                if (this.ChoiceTree == null)
                {
                    this.ChoiceTree = new GameDesignerChoiceTree(this.GameDesignerEditorProfile);
                }
            }
        }