SetInt() private method

private SetInt ( string key, int value ) : void
key string
value int
return void
Exemplo n.º 1
0
 protected virtual void SetVisibilityState(ModuleUI.VisibilityState newState)
 {
     if (newState != this.m_VisibilityState)
     {
         if (newState == ModuleUI.VisibilityState.VisibleAndFolded)
         {
             ParticleSystemCurveEditor particleSystemCurveEditor = this.m_ParticleSystemUI.m_ParticleEffectUI.GetParticleSystemCurveEditor();
             foreach (SerializedProperty current in this.m_ModuleCurves)
             {
                 if (particleSystemCurveEditor.IsAdded(current))
                 {
                     this.m_CurvesRemovedWhenFolded.Add(current);
                     particleSystemCurveEditor.SetVisible(current, false);
                 }
             }
             particleSystemCurveEditor.Refresh();
         }
         else if (newState == ModuleUI.VisibilityState.VisibleAndFoldedOut)
         {
             ParticleSystemCurveEditor particleSystemCurveEditor2 = this.m_ParticleSystemUI.m_ParticleEffectUI.GetParticleSystemCurveEditor();
             foreach (SerializedProperty current2 in this.m_CurvesRemovedWhenFolded)
             {
                 particleSystemCurveEditor2.SetVisible(current2, true);
             }
             this.m_CurvesRemovedWhenFolded.Clear();
             particleSystemCurveEditor2.Refresh();
         }
         this.m_VisibilityState = newState;
         SessionState.SetInt(base.GetUniqueModuleName(), (int)this.m_VisibilityState);
         if (newState == ModuleUI.VisibilityState.VisibleAndFoldedOut)
         {
             this.Init();
         }
     }
 }
Exemplo n.º 2
0
        public void OnDisable()
        {
            Stop();

            m_CurveEditor.OnDisable();
            s_Inspectors.Remove(this);
            SceneView.duringSceneGui -= OnSceneViewGUI;
            EditorApplication.update -= RepaintSceneView;
            ShortcutIntegration.instance.contextManager.DeregisterToolContext(m_ShortcutContext);

            SessionState.SetFloat(k_PreviewMovementSpeed, s_PreviewMovementSpeed);
            SessionState.SetFloat(k_PreviewTimeScale, s_PreviewTimeScale);
            SessionState.SetInt(k_PreviewShape, (int)s_PreviewShape);
            SessionState.SetFloat(k_PreviewShapeSize, s_PreviewShapeSize);
        }
Exemplo n.º 3
0
 protected virtual void SetVisibilityState(ModuleUI.VisibilityState newState)
 {
     if (newState == this.m_VisibilityState)
     {
         return;
     }
     if (newState == ModuleUI.VisibilityState.VisibleAndFolded)
     {
         ParticleSystemCurveEditor systemCurveEditor = this.m_ParticleSystemUI.m_ParticleEffectUI.GetParticleSystemCurveEditor();
         using (List <SerializedProperty> .Enumerator enumerator = this.m_ModuleCurves.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 SerializedProperty current = enumerator.Current;
                 if (systemCurveEditor.IsAdded(current))
                 {
                     this.m_CurvesRemovedWhenFolded.Add(current);
                     systemCurveEditor.SetVisible(current, false);
                 }
             }
         }
         systemCurveEditor.Refresh();
     }
     else if (newState == ModuleUI.VisibilityState.VisibleAndFoldedOut)
     {
         ParticleSystemCurveEditor systemCurveEditor = this.m_ParticleSystemUI.m_ParticleEffectUI.GetParticleSystemCurveEditor();
         using (List <SerializedProperty> .Enumerator enumerator = this.m_CurvesRemovedWhenFolded.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 SerializedProperty current = enumerator.Current;
                 systemCurveEditor.SetVisible(current, true);
             }
         }
         this.m_CurvesRemovedWhenFolded.Clear();
         systemCurveEditor.Refresh();
     }
     this.m_VisibilityState = newState;
     SessionState.SetInt(this.GetUniqueModuleName(), (int)this.m_VisibilityState);
     if (newState != ModuleUI.VisibilityState.VisibleAndFoldedOut)
     {
         return;
     }
     this.Init();
 }
Exemplo n.º 4
0
        protected virtual void SetVisibilityState(VisibilityState newState)
        {
            if (newState != m_VisibilityState)
            {
                if (newState == VisibilityState.VisibleAndFolded)
                {
                    // Remove curves from the curveeditor when closing modules (and put them back when folding out again)
                    ParticleSystemCurveEditor psce = m_ParticleSystemUI.m_ParticleEffectUI.GetParticleSystemCurveEditor();
                    foreach (SerializedProperty curveProp in m_ModuleCurves)
                    {
                        if (psce.IsAdded(curveProp))
                        {
                            m_CurvesRemovedWhenFolded.Add(curveProp);
                            psce.SetVisible(curveProp, false);
                        }
                    }
                    psce.Refresh();
                }
                else if (newState == VisibilityState.VisibleAndFoldedOut)
                {
                    ParticleSystemCurveEditor psce = m_ParticleSystemUI.m_ParticleEffectUI.GetParticleSystemCurveEditor();
                    foreach (SerializedProperty curveProp in m_CurvesRemovedWhenFolded)
                    {
                        psce.SetVisible(curveProp, true);
                    }
                    m_CurvesRemovedWhenFolded.Clear();
                    psce.Refresh();
                }

                m_VisibilityState = newState;
                foreach (Object obj in serializedObject.targetObjects)
                {
                    SessionState.SetInt(GetUniqueModuleName(obj), (int)m_VisibilityState);
                }

                if (newState == VisibilityState.VisibleAndFoldedOut)
                {
                    Init();
                }
            }
        }