コード例 #1
0
 public static void ShowWindow()
 {
     playgroundSettings = PlaygroundSettingsC.GetReference();
     playgroundLanguage = PlaygroundSettingsC.GetLanguage();
     window             = EditorWindow.GetWindow <PlaygroundCreatePresetWindowC>(true, playgroundLanguage.presetWizard);
     window.Show();
 }
コード例 #2
0
 public static void ShowWindow()
 {
     playgroundSettings = PlaygroundSettingsC.GetReference();
     playgroundLanguage = PlaygroundSettingsC.GetLanguage();
     window             = EditorWindow.GetWindow <PlaygroundPresetCategoryWindowC>(true, playgroundLanguage.presetManager);
     window.Show();
 }
コード例 #3
0
    public void OnEnable()
    {
        trails   = target as PlaygroundTrails;
        s_trails = new SerializedObject(trails);

        s_time = s_trails.FindProperty("time");

        s_material           = s_trails.FindProperty("material");
        s_lifetimeColor      = s_trails.FindProperty("lifetimeColor");
        s_colorMode          = s_trails.FindProperty("colorMode");
        s_uvMode             = s_trails.FindProperty("uvMode");
        s_pointArrayAlpha    = s_trails.FindProperty("pointArrayAlpha");
        s_renderMode         = s_trails.FindProperty("renderMode");
        s_billboardTransform = s_trails.FindProperty("billboardTransform");
        s_customRenderScale  = s_trails.FindProperty("customRenderScale");

        s_timeWidth  = s_trails.FindProperty("timeWidth");
        s_widthScale = s_trails.FindProperty("widthScale");

        s_minVertexDistance       = s_trails.FindProperty("minVertexDistance");
        s_maxVertexDistance       = s_trails.FindProperty("maxVertexDistance");
        s_maxPathDeviation        = s_trails.FindProperty("maxPathDeviation");
        s_createPointsOnCollision = s_trails.FindProperty("createPointsOnCollision");
        s_maxPoints = s_trails.FindProperty("maxPoints");
        s_createFirstPointOnParticleBirth = s_trails.FindProperty("createFirstPointOnParticleBirth");
        s_createLastPointOnParticleDeath  = s_trails.FindProperty("createLastPointOnParticleDeath");

        s_playgroundSystem = s_trails.FindProperty("playgroundSystem");
        s_multithreading   = s_trails.FindProperty("multithreading");

        s_receiveShadows = s_trails.FindProperty("receiveShadows");
#if UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7
        s_castShadows = s_trails.FindProperty("castShadows");
#else
        s_castShadows = s_trails.FindProperty("shadowCastingMode");
#endif
        s_layer = s_trails.FindProperty("layer");

        s_trails.Update();
        if (s_layer.intValue < 0)
        {
            s_layer.intValue = trails.playgroundSystem.gameObject.layer;
        }
        s_layer.intValue = Mathf.Clamp(s_layer.intValue, 0, 32);
#if UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        s_trails.ApplyModifiedProperties();
#else
        s_trails.ApplyModifiedPropertiesWithoutUndo();
#endif
        playgroundSettings = PlaygroundSettingsC.GetReference();
        playgroundLanguage = PlaygroundSettingsC.GetLanguage();

        // Issue a quick refresh
        if (!EditorApplication.isPlaying && Selection.activeTransform != null)
        {
            trails.ResetTrails();
        }
    }
コード例 #4
0
    void OnGUI()
    {
        EditorGUILayout.BeginVertical();
        scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, false);
        EditorGUILayout.Separator();
        EditorGUILayout.LabelField(PlaygroundParticleWindowC.playgroundLanguage.languageInstallWizard, EditorStyles.largeLabel, GUILayout.Height(20));
        EditorGUILayout.Separator();

        EditorGUILayout.HelpBox(PlaygroundParticleWindowC.playgroundLanguage.installText, MessageType.Info);
        EditorGUILayout.Separator();

        installType = (LanguageInstallType)EditorGUILayout.EnumPopup(PlaygroundParticleWindowC.playgroundLanguage.installType, installType);
        if (installType == LanguageInstallType.Asset)
        {
            languageFile = (PlaygroundLanguageC)EditorGUILayout.ObjectField(PlaygroundParticleWindowC.playgroundLanguage.languageFile, languageFile, typeof(PlaygroundLanguageC), false);
        }
        else
        {
            EditorGUILayout.BeginHorizontal();
            languageLocation = EditorGUILayout.TextField(PlaygroundParticleWindowC.playgroundLanguage.languageLocation, languageLocation);
            if (GUILayout.Button(PlaygroundParticleWindowC.playgroundLanguage.browse, EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
            {
                string newLanguageLocation = EditorUtility.OpenFilePanel(PlaygroundParticleWindowC.playgroundLanguage.languageLocation, "", "xml");
                if (newLanguageLocation.Length != 0)
                {
                    languageLocation = newLanguageLocation;
                }
            }
            EditorGUILayout.EndHorizontal();
        }

        EditorGUILayout.Separator();

        GUI.enabled = (installType == LanguageInstallType.Asset && languageFile != null || installType == LanguageInstallType.Xml && languageLocation.Length > 0 && languageLocation.ToLower().Contains(".xml"));
        if (GUILayout.Button(PlaygroundParticleWindowC.playgroundLanguage.install, EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
        {
            if (installType == LanguageInstallType.Asset)
            {
                if (!PlaygroundParticleWindowC.playgroundSettings.languages.Contains(languageFile))
                {
                    AssetDatabase.MoveAsset(AssetDatabase.GetAssetPath((Object)languageFile), "Assets/" + PlaygroundParticleWindowC.playgroundSettings.playgroundPath + PlaygroundParticleWindowC.playgroundSettings.languagePath + languageFile.name);
                    PlaygroundParticleWindowC.playgroundSettings.languages.Add(languageFile);
                    EditorUtility.SetDirty(PlaygroundParticleWindowC.playgroundSettings);
                }
            }
            else
            {
                PlaygroundSettingsC.ImportLanguage(languageLocation);
            }
            window.Close();
        }
        GUI.enabled = true;

        GUILayout.EndScrollView();
        EditorGUILayout.EndVertical();
    }
コード例 #5
0
    void OnEnable()
    {
        spline = target as PlaygroundSpline;

        playgroundSettings = PlaygroundSettingsC.GetReference();
        playgroundLanguage = PlaygroundSettingsC.GetLanguage();

        lastActiveTool = UnityEditor.Tools.current;

        UpdateUserList();
    }
コード例 #6
0
    void OnEnable()
    {
        playgroundLanguage = PlaygroundSettingsC.GetLanguage();

        brushPreset         = new SerializedObject(target);
        texture             = brushPreset.FindProperty("texture");
        presetName          = brushPreset.FindProperty("presetName");
        scale               = brushPreset.FindProperty("scale");
        detail              = brushPreset.FindProperty("detail");
        distance            = brushPreset.FindProperty("distance");
        spacing             = brushPreset.FindProperty("spacing");
        exceedMaxStopsPaint = brushPreset.FindProperty("exceedMaxStopsPaint");
    }
コード例 #7
0
    public void OnEnable()
    {
        follow   = target as PlaygroundFollow;
        s_follow = new SerializedObject(follow);

        s_particles        = s_follow.FindProperty("particles");
        s_referenceObject  = s_follow.FindProperty("referenceObject");
        s_followerLifetime = s_follow.FindProperty("followerLifetime");
        s_cacheSize        = s_follow.FindProperty("cacheSize");
        s_sendEvents       = s_follow.FindProperty("sendEvents");

        playgroundSettings = PlaygroundSettingsC.GetReference();
        playgroundLanguage = PlaygroundSettingsC.GetLanguage();
    }
コード例 #8
0
    void OnEnable()
    {
        // Set references
        recorder = target as PlaygroundRecorder;

        // Load settings
        playgroundSettings = PlaygroundSettingsC.GetReference();

        // Load language
        playgroundLanguage = PlaygroundSettingsC.GetLanguage();

        // Load data
        if (recorder.recorderData != null)
        {
            recorder.LoadAsync();
        }
        else
        {
            recorder.recordedFrames = new List <RecordedFrame>();
        }
    }
コード例 #9
0
    public static void ImportLanguage(string xmlPath)
    {
        if (xmlPath.Length != 0)
        {
            XmlDocument xml = new XmlDocument();
            xml.Load(xmlPath);
            XmlNode nameNode = xml.SelectSingleNode("//languageNameSeenByEnglish");

            if (nameNode != null)
            {
                PlaygroundLanguageC newLanguage = PlaygroundLanguageC.New(nameNode.InnerText.Length > 0?nameNode.InnerText:"New Language");

                SerializedObject   serializedLanguage = new SerializedObject(newLanguage);
                SerializedProperty languageProperty   = serializedLanguage.GetIterator();
                XmlNodeList        nodeList           = xml.FirstChild.ChildNodes;
                while (languageProperty.Next(true))
                {
                    if (languageProperty.propertyType == SerializedPropertyType.String)
                    {
                        if (languageProperty.propertyType == SerializedPropertyType.String)
                        {
                            foreach (XmlNode node in nodeList)
                            {
                                if (node != null && node.InnerText.Length != 0 && node.NodeType == XmlNodeType.Element && node.LocalName == languageProperty.propertyPath)
                                {
                                    languageProperty.stringValue = node.InnerText;
                                }
                            }
                        }
                    }
                }

                serializedLanguage.ApplyModifiedProperties();
                reference.languages.Add(newLanguage);
                EditorUtility.SetDirty(reference);
            }
        }
    }
コード例 #10
0
    public static void ExportLanguage(PlaygroundLanguageC selectedLanguage)
    {
        string xmlPath = EditorUtility.SaveFilePanel(selectedLanguage.saveLanguage, "", "Particle Playground Language - " + selectedLanguage.languageNameSeenByEnglish + ".xml", "xml");

        if (xmlPath.Length != 0)
        {
            XmlDocument xml      = new XmlDocument();
            XmlNode     rootNode = xml.CreateElement("Playground");
            xml.AppendChild(rootNode);
            SerializedObject   serializedLanguage = new SerializedObject(selectedLanguage);
            SerializedProperty languageProperty   = serializedLanguage.GetIterator();
            while (languageProperty.Next(true))
            {
                if (languageProperty.propertyType == SerializedPropertyType.String)
                {
                    XmlNode newNode = xml.CreateElement(languageProperty.propertyPath);
                    newNode.InnerText = languageProperty.stringValue;
                    rootNode.AppendChild(newNode);
                }
            }
            xml.Save(xmlPath);
        }
    }
コード例 #11
0
 public static void ShowWindow()
 {
     playgroundLanguage = PlaygroundSettingsC.GetLanguage();
     window             = EditorWindow.GetWindow <PlaygroundCreateBrushWindowC>(true, playgroundLanguage.brushWizard);
     window.Show();
 }