Refresh() public method

public Refresh ( ) : void
return void
Esempio 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();
         }
     }
 }
Esempio n. 2
0
        public static void PasteAnimationCurves(SerializedProperty animCurveProperty, SerializedProperty animCurveProperty2, SerializedProperty scalarProperty, Rect curveRanges, ParticleSystemCurveEditor particleSystemCurveEditor)
        {
            if (animCurveProperty != null && m_AnimationCurve1 != null)
            {
                animCurveProperty.animationCurveValue = m_AnimationCurve1;
                ClampCurve(animCurveProperty, curveRanges);
            }

            if (animCurveProperty2 != null && m_AnimationCurve2 != null)
            {
                animCurveProperty2.animationCurveValue = m_AnimationCurve2;
                ClampCurve(animCurveProperty2, curveRanges);
            }

            if (scalarProperty != null)
            {
                scalarProperty.floatValue = m_AnimationCurveScalar;
            }

            // Ensure refresh of systems that uses curves
            if (particleSystemCurveEditor != null)
            {
                particleSystemCurveEditor.Refresh();
            }
        }
Esempio 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();
 }
Esempio 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();
                }
            }
        }
 public static void PasteAnimationCurves(SerializedProperty animCurveProperty, SerializedProperty animCurveProperty2, SerializedProperty scalarProperty, Rect curveRanges, ParticleSystemCurveEditor particleSystemCurveEditor)
 {
     if ((animCurveProperty != null) && (m_AnimationCurve1 != null))
     {
         animCurveProperty.animationCurveValue = m_AnimationCurve1;
         ClampCurve(animCurveProperty, curveRanges);
     }
     if ((animCurveProperty2 != null) && (m_AnimationCurve2 != null))
     {
         animCurveProperty2.animationCurveValue = m_AnimationCurve2;
         ClampCurve(animCurveProperty2, curveRanges);
     }
     if (scalarProperty != null)
     {
         scalarProperty.floatValue = m_AnimationCurveScalar;
     }
     if (particleSystemCurveEditor != null)
     {
         particleSystemCurveEditor.Refresh();
     }
 }
 public static void PasteAnimationCurves(SerializedProperty animCurveProperty, SerializedProperty animCurveProperty2, SerializedProperty scalarProperty, Rect curveRanges, ParticleSystemCurveEditor particleSystemCurveEditor)
 {
     if (animCurveProperty != null && ParticleSystemClipboard.m_AnimationCurve1 != null)
     {
         animCurveProperty.animationCurveValue = ParticleSystemClipboard.m_AnimationCurve1;
         ParticleSystemClipboard.ClampCurve(animCurveProperty, curveRanges);
     }
     if (animCurveProperty2 != null && ParticleSystemClipboard.m_AnimationCurve2 != null)
     {
         animCurveProperty2.animationCurveValue = ParticleSystemClipboard.m_AnimationCurve2;
         ParticleSystemClipboard.ClampCurve(animCurveProperty2, curveRanges);
     }
     if (scalarProperty != null)
     {
         scalarProperty.floatValue = ParticleSystemClipboard.m_AnimationCurveScalar;
     }
     if (particleSystemCurveEditor != null)
     {
         particleSystemCurveEditor.Refresh();
     }
 }
 public static void PasteAnimationCurves(SerializedProperty animCurveProperty, SerializedProperty animCurveProperty2, SerializedProperty scalarProperty, Rect curveRanges, ParticleSystemCurveEditor particleSystemCurveEditor)
 {
   if (animCurveProperty != null && ParticleSystemClipboard.m_AnimationCurve1 != null)
   {
     animCurveProperty.animationCurveValue = ParticleSystemClipboard.m_AnimationCurve1;
     ParticleSystemClipboard.ClampCurve(animCurveProperty, curveRanges);
   }
   if (animCurveProperty2 != null && ParticleSystemClipboard.m_AnimationCurve2 != null)
   {
     animCurveProperty2.animationCurveValue = ParticleSystemClipboard.m_AnimationCurve2;
     ParticleSystemClipboard.ClampCurve(animCurveProperty2, curveRanges);
   }
   if (scalarProperty != null)
     scalarProperty.floatValue = ParticleSystemClipboard.m_AnimationCurveScalar;
   if (particleSystemCurveEditor == null)
     return;
   particleSystemCurveEditor.Refresh();
 }
Esempio n. 8
0
 public void Refresh()
 {
     UpdateProperties();
     m_ParticleSystemCurveEditor.Refresh();
 }