Exemple #1
0
        private void CreateSaveData(COVER_MODE coverMode, EasyFlow easyflow)
        {
            // Create SaveData instance
            easyflow.saveData            = ScriptableObject.CreateInstance <SaveData>();
            easyflow.saveData.coverMode  = coverMode;
            easyflow.saveData.coverCount = SettingData.GetInstance().defaultCoverCount;

            // Load Sample Textures ("Assets/EasyFlow/Resources/TextureSample")
            UnityEngine.Object[] objList = Resources.LoadAll("TextureSample", typeof(Texture));
            if (objList != null)
            {
                easyflow.saveData.textureList = new List <Texture>(objList.Length);
                foreach (Texture texture in objList)
                {
                    easyflow.saveData.textureList.Add(texture);
                }
            }

            string directoryPath = string.Format("{0}/SaveData", PathEF.assetPath);

            // Directory Exists(false) : Create Directory
            if (Directory.Exists(directoryPath) == false)
            {
                Directory.CreateDirectory(directoryPath);
            }

            // Save SaveData file
            UnityEditor.AssetDatabase.CreateAsset(easyflow.saveData, string.Format("{0}/SaveData_{1}.asset", directoryPath, easyflow.GetInstanceID()));
            UnityEditor.AssetDatabase.SaveAssets();
            UnityEditor.AssetDatabase.Refresh();
        }
Exemple #2
0
        public static void OpenWindow()
        {
            SettingTool window = (SettingTool)EditorWindow.GetWindow(typeof(SettingTool), false, "EF:SettingTool", true);

            window.autoRepaintOnSceneChange = true;
            window.minSize     = new Vector2(440.0f, 145.0f);
            window.settingData = SettingData.GetInstance();
        }
        private void OnEnable()
        {
            switch (SettingData.GetInstance().linkMode)
            {
            case LINK_MODE.Link:
                if (Selection.activeGameObject != null)
                {
                    EasyFlow easyflow = Selection.activeGameObject.GetComponent <EasyFlow>();
                    OptionTool.SetEasyflow(easyflow);
                    PresetTool.SetEasyflow(easyflow);
                }
                else
                {
                    OptionTool.SetEasyflow(null);
                    PresetTool.SetEasyflow(null);
                }
                break;

            case LINK_MODE.OpenPresetTool:
                if (Selection.activeGameObject != null)
                {
                    EasyFlow easyflow = Selection.activeGameObject.GetComponent <EasyFlow>();
                    if (easyflow != null)
                    {
                        PresetTool.OpenWindow(easyflow);
                    }
                }
                break;

            case LINK_MODE.OpenOptionTool:
                if (Selection.activeGameObject != null)
                {
                    EasyFlow easyflow = Selection.activeGameObject.GetComponent <EasyFlow>();
                    if (easyflow != null)
                    {
                        OptionTool.OpenWindow(easyflow);
                    }
                }
                break;
            }
        }
Exemple #4
0
 private void CreateCover(COVER_MODE coverMode, EasyFlow easyflow, GameObject panel)
 {
     easyflow.saveData.coverMode = coverMode;
     easyflow.ChangeCoverCount(SettingData.GetInstance().defaultCoverCount);
 }
Exemple #5
0
 private void OnSelectionChange()
 {
     settingData = SettingData.GetInstance();
 }
Exemple #6
0
 private void OnEnable()
 {
     settingData = SettingData.GetInstance();
 }