public GameObject CreateParticleSystem(ParticleSystem parentOfNewParticleSystem, SubModuleUI.SubEmitterType defaultType) { string nextParticleSystemName = this.GetNextParticleSystemName(); GameObject gameObject = new GameObject(nextParticleSystemName, new Type[] { typeof(ParticleSystem) }); if (gameObject) { if (parentOfNewParticleSystem) { gameObject.transform.parent = parentOfNewParticleSystem.transform; } gameObject.transform.localPosition = Vector3.zero; gameObject.transform.localRotation = Quaternion.identity; ParticleSystem component = gameObject.GetComponent <ParticleSystem>(); if (defaultType != SubModuleUI.SubEmitterType.None) { component.SetupDefaultType((int)defaultType); } SessionState.SetFloat("CurrentEmitterAreaScroll", this.m_EmitterAreaScrollPos.x); return(gameObject); } return(null); }
public GameObject CreateParticleSystem(ParticleSystem parentOfNewParticleSystem, SubModuleUI.SubEmitterType defaultType) { GameObject gameObject = new GameObject(this.GetNextParticleSystemName(), new System.Type[1] { typeof(ParticleSystem) }); if (!(bool)((UnityEngine.Object)gameObject)) { return((GameObject)null); } if ((bool)((UnityEngine.Object)parentOfNewParticleSystem)) { gameObject.transform.parent = parentOfNewParticleSystem.transform; } gameObject.transform.localPosition = Vector3.zero; gameObject.transform.localRotation = Quaternion.identity; ParticleSystem component = gameObject.GetComponent <ParticleSystem>(); if (defaultType != SubModuleUI.SubEmitterType.None) { component.SetupDefaultType((int)defaultType); } SessionState.SetFloat("CurrentEmitterAreaScroll", this.m_EmitterAreaScrollPos.x); return(gameObject); }
public GameObject CreateParticleSystem(ParticleSystem parentOfNewParticleSystem, SubModuleUI.SubEmitterType defaultType) { System.Type[] components = new System.Type[] { typeof(ParticleSystem) }; GameObject obj2 = new GameObject(this.GetNextParticleSystemName(), components); if (obj2 != null) { if (parentOfNewParticleSystem != null) { obj2.transform.parent = parentOfNewParticleSystem.transform; } obj2.transform.localPosition = Vector3.zero; obj2.transform.localRotation = Quaternion.identity; ParticleSystem component = obj2.GetComponent <ParticleSystem>(); if (defaultType != SubModuleUI.SubEmitterType.None) { component.SetupDefaultType((int)defaultType); } SessionState.SetFloat("CurrentEmitterAreaScroll", this.m_EmitterAreaScrollPos.x); Material[] materialArray1 = new Material[2]; materialArray1[0] = AssetDatabase.GetBuiltinExtraResource <Material>("Default-Particle.mat"); obj2.GetComponent <ParticleSystemRenderer>().materials = materialArray1; return(obj2); } return(null); }
public void OnDisable() { if (this.m_TreeView != null) { this.m_TreeView.SerializeState(this.m_SerializationUID); } SessionState.SetFloat(this.m_SerializationUID + SerializedPropertyTable.s_TableHeight, this.m_TableHeight); }
public void OnDisable() { if (m_TreeView != null) { m_TreeView.SerializeState(m_SerializationUID); } SessionState.SetFloat(m_SerializationUID + s_TableHeight, m_TableHeight); }
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); }
public GameObject CreateParticleSystem(ParticleSystem parentOfNewParticleSystem, SubModuleUI.SubEmitterType defaultType) { string nextParticleSystemName = this.GetNextParticleSystemName(); GameObject gameObject = new GameObject(nextParticleSystemName, new Type[] { typeof(ParticleSystem) }); GameObject result; if (gameObject) { if (parentOfNewParticleSystem) { gameObject.transform.parent = parentOfNewParticleSystem.transform; } gameObject.transform.localPosition = Vector3.zero; gameObject.transform.localRotation = Quaternion.identity; ParticleSystem component = gameObject.GetComponent <ParticleSystem>(); if (defaultType != SubModuleUI.SubEmitterType.None) { component.SetupDefaultType((int)defaultType); } SessionState.SetFloat("CurrentEmitterAreaScroll", this.m_EmitterAreaScrollPos.x); ParticleSystemRenderer component2 = gameObject.GetComponent <ParticleSystemRenderer>(); Material material = null; if (GraphicsSettings.renderPipelineAsset != null) { material = GraphicsSettings.renderPipelineAsset.GetDefaultParticleMaterial(); } if (material == null) { material = AssetDatabase.GetBuiltinExtraResource <Material>("Default-Particle.mat"); } Renderer arg_DF_0 = component2; Material[] expr_DA = new Material[2]; expr_DA[0] = material; arg_DF_0.materials = expr_DA; Undo.RegisterCreatedObjectUndo(gameObject, "Create ParticleSystem"); result = gameObject; } else { result = null; } return(result); }
public GameObject CreateParticleSystem(ParticleSystem parentOfNewParticleSystem, SubModuleUI.SubEmitterType defaultType) { string name = GetNextParticleSystemName(); GameObject go = new GameObject(name, typeof(ParticleSystem)); if (go) { if (parentOfNewParticleSystem) { go.transform.parent = parentOfNewParticleSystem.transform; } go.transform.localPosition = Vector3.zero; go.transform.localRotation = Quaternion.identity; // Setup particle system based on type ParticleSystem ps = go.GetComponent <ParticleSystem>(); if (defaultType != SubModuleUI.SubEmitterType.None) { ps.SetupDefaultType((int)defaultType); } SessionState.SetFloat("CurrentEmitterAreaScroll", m_EmitterAreaScrollPos.x); // Assign default material ParticleSystemRenderer renderer = go.GetComponent <ParticleSystemRenderer>(); Material particleMat = null; if (GraphicsSettings.renderPipelineAsset != null) { particleMat = GraphicsSettings.renderPipelineAsset.GetDefaultParticleMaterial(); } if (particleMat == null) { particleMat = AssetDatabase.GetBuiltinExtraResource <Material>("Default-Particle.mat"); } renderer.materials = new[] { particleMat, null }; Undo.RegisterCreatedObjectUndo(go, "Create ParticleSystem"); return(go); } return(null); }
public GameObject CreateParticleSystem(ParticleSystem parentOfNewParticleSystem, SubModuleUI.SubEmitterType defaultType) { Type[] components = new Type[] { typeof(ParticleSystem) }; GameObject obj2 = new GameObject(this.GetNextParticleSystemName(), components); if (obj2 == null) { return(null); } if (parentOfNewParticleSystem != null) { obj2.transform.parent = parentOfNewParticleSystem.transform; } obj2.transform.localPosition = Vector3.zero; obj2.transform.localRotation = Quaternion.identity; ParticleSystem component = obj2.GetComponent <ParticleSystem>(); if (defaultType != SubModuleUI.SubEmitterType.None) { component.SetupDefaultType((int)defaultType); } SessionState.SetFloat("CurrentEmitterAreaScroll", this.m_EmitterAreaScrollPos.x); return(obj2); }