Exemplo n.º 1
0
 public override void OnInspectorGUI(InitialModuleUI initial)
 {
     if (InheritVelocityModuleUI.s_Texts == null)
     {
         InheritVelocityModuleUI.s_Texts = new InheritVelocityModuleUI.Texts();
     }
     ModuleUI.GUIPopup(InheritVelocityModuleUI.s_Texts.mode, this.m_Mode, InheritVelocityModuleUI.s_Texts.modes, new GUILayoutOption[0]);
     ModuleUI.GUIMinMaxCurve(InheritVelocityModuleUI.s_Texts.velocity, this.m_Curve, new GUILayoutOption[0]);
     if (this.m_Curve.scalar.floatValue != 0f)
     {
         ParticleSystem[] particleSystems = this.m_ParticleSystemUI.m_ParticleSystems;
         for (int i = 0; i < particleSystems.Length; i++)
         {
             ParticleSystem particleSystem     = particleSystems[i];
             Rigidbody      componentInParent  = particleSystem.GetComponentInParent <Rigidbody>();
             Rigidbody2D    componentInParent2 = particleSystem.GetComponentInParent <Rigidbody2D>();
             if (componentInParent != null && !componentInParent.isKinematic)
             {
                 EditorGUILayout.HelpBox("Velocity is being driven by RigidBody(" + componentInParent.name + ")", MessageType.Info, true);
             }
             else if (componentInParent2 != null && componentInParent2.bodyType == RigidbodyType2D.Dynamic)
             {
                 EditorGUILayout.HelpBox("Velocity is being driven by RigidBody2D(" + componentInParent2.name + ")", MessageType.Info, true);
             }
         }
     }
 }
 protected override void Init()
 {
   if (this.m_Curve != null)
     return;
   if (InheritVelocityModuleUI.s_Texts == null)
     InheritVelocityModuleUI.s_Texts = new InheritVelocityModuleUI.Texts();
   this.m_Mode = this.GetProperty("m_Mode");
   this.m_Curve = new SerializedMinMaxCurve((ModuleUI) this, GUIContent.none, "m_Curve", ModuleUI.kUseSignedRange);
 }
 public override void OnInspectorGUI(InitialModuleUI initial)
 {
     if (InheritVelocityModuleUI.s_Texts == null)
     {
         InheritVelocityModuleUI.s_Texts = new InheritVelocityModuleUI.Texts();
     }
     ModuleUI.GUIPopup(InheritVelocityModuleUI.s_Texts.mode, this.m_Mode, InheritVelocityModuleUI.s_Texts.modes, new GUILayoutOption[0]);
     ModuleUI.GUIMinMaxCurve(InheritVelocityModuleUI.s_Texts.velocity, this.m_Curve, new GUILayoutOption[0]);
 }
 public override void OnInspectorGUI(ParticleSystem s)
 {
   if (InheritVelocityModuleUI.s_Texts == null)
     InheritVelocityModuleUI.s_Texts = new InheritVelocityModuleUI.Texts();
   ModuleUI.GUIPopup(InheritVelocityModuleUI.s_Texts.mode, this.m_Mode, InheritVelocityModuleUI.s_Texts.modes);
   ModuleUI.GUIMinMaxCurve(GUIContent.none, this.m_Curve);
   if ((double) this.m_Curve.scalar.floatValue == 0.0 || this.CanInheritVelocity(s))
     return;
   EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("Inherit velocity requires interpolation enabled on the rigidbody to function correctly.").text, MessageType.Warning, true);
 }
Exemplo n.º 5
0
 protected override void Init()
 {
     if (this.m_Curve == null)
     {
         if (InheritVelocityModuleUI.s_Texts == null)
         {
             InheritVelocityModuleUI.s_Texts = new InheritVelocityModuleUI.Texts();
         }
         this.m_Mode  = base.GetProperty("m_Mode");
         this.m_Curve = new SerializedMinMaxCurve(this, GUIContent.none, "m_Curve", ModuleUI.kUseSignedRange);
     }
 }
Exemplo n.º 6
0
 public override void OnInspectorGUI(ParticleSystem s)
 {
     if (InheritVelocityModuleUI.s_Texts == null)
     {
         InheritVelocityModuleUI.s_Texts = new InheritVelocityModuleUI.Texts();
     }
     ModuleUI.GUIPopup(InheritVelocityModuleUI.s_Texts.mode, this.m_Mode, InheritVelocityModuleUI.s_Texts.modes);
     ModuleUI.GUIMinMaxCurve(GUIContent.none, this.m_Curve);
     if (this.m_Curve.scalar.floatValue != 0f && !this.CanInheritVelocity(s))
     {
         GUIContent gUIContent = EditorGUIUtility.TextContent("Inherit velocity requires interpolation enabled on the rigidbody to function correctly.");
         EditorGUILayout.HelpBox(gUIContent.text, MessageType.Warning, true);
     }
 }