Ejemplo n.º 1
0
	public void ApplyOptions () {
		FX = GetComponent<ParticleSystemRenderer> ();
		if(Options.ThreeDParticles)
			FX.renderMode = ParticleSystemRenderMode.Mesh;
		else
			FX.renderMode = ParticleSystemRenderMode.Billboard;
	}
Ejemplo n.º 2
0
 static public int SetMeshes(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
             UnityEngine.Mesh[] a1;
             checkType(l, 2, out a1);
             self.SetMeshes(a1);
             return(0);
         }
         else if (argc == 3)
         {
             UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
             UnityEngine.Mesh[] a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             self.SetMeshes(a1, a2);
             return(0);
         }
         return(error(l, "No matched override function to call"));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     c = Color.white;
     parts = GetComponent<ParticleSystem>();
     partRends = GetComponent<ParticleSystemRenderer>();
     hit = false;
 }
Ejemplo n.º 4
0
    static public void FastSetter(this UnityEngine.ParticleSystemRenderer o, string propertyName, System.Single value)
    {
        switch (propertyName)
        {
        case "lengthScale":
            o.lengthScale = value; return;

        case "velocityScale":
            o.velocityScale = value; return;

        case "cameraVelocityScale":
            o.cameraVelocityScale = value; return;

        case "normalDirection":
            o.normalDirection = value; return;

        case "sortingFudge":
            o.sortingFudge = value; return;

        case "minParticleSize":
            o.minParticleSize = value; return;

        case "maxParticleSize":
            o.maxParticleSize = value; return;
        }
        LBoot.LogUtil.Error("UnityEngine.ParticleSystemRenderer no Setter Found : " + propertyName);
    }
 static public int constructor(IntPtr l)
 {
     UnityEngine.ParticleSystemRenderer o;
     o = new UnityEngine.ParticleSystemRenderer();
     pushObject(l, o);
     return(1);
 }
Ejemplo n.º 6
0
		public override void Init()
		{
			base.Init();

			Renderer = ParticleSystem.GetComponent<ParticleSystemRenderer>();
			Particles = new ParticleSystem.Particle[ParticleCount];
		}
Ejemplo n.º 7
0
	public ParticleState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
		: base( owner, obj )
	{
		m_particleSystem = m_obj.GetComponent<ParticleSystem>();
		m_renderer = m_particleSystem.GetComponent<ParticleSystemRenderer>();
		rotationOverLifetime = m_particleSystem.rotationOverLifetime;
		rotationBySpeed = m_particleSystem.rotationBySpeed;
	}
Ejemplo n.º 8
0
 static public int set_renderMode(IntPtr l)
 {
     UnityEngine.ParticleSystemRenderer   o = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
     UnityEngine.ParticleSystemRenderMode v;
     checkEnum(l, 2, out v);
     o.renderMode = v;
     return(0);
 }
Ejemplo n.º 9
0
 static public int set_mesh(IntPtr l)
 {
     UnityEngine.ParticleSystemRenderer o = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
     UnityEngine.Mesh v;
     checkType(l, 2, out v);
     o.mesh = v;
     return(0);
 }
Ejemplo n.º 10
0
    static public int set_maxParticleSize(IntPtr l)
    {
        UnityEngine.ParticleSystemRenderer o = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
        float v;

        checkType(l, 2, out v);
        o.maxParticleSize = v;
        return(0);
    }
Ejemplo n.º 11
0
    static public int set_cameraVelocityScale(IntPtr l)
    {
        UnityEngine.ParticleSystemRenderer o = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
        float v;

        checkType(l, 2, out v);
        o.cameraVelocityScale = v;
        return(0);
    }
Ejemplo n.º 12
0
 static public void FastSetter(this UnityEngine.ParticleSystemRenderer o, string propertyName, UnityEngine.Mesh value)
 {
     switch (propertyName)
     {
     case "mesh":
         o.mesh = value; return;
     }
     LBoot.LogUtil.Error("UnityEngine.ParticleSystemRenderer no Setter Found : " + propertyName);
 }
Ejemplo n.º 13
0
    static public object FastGetter(this UnityEngine.ParticleSystemRenderer o, string propertyName)
    {
        switch (propertyName)
        {
        case "renderMode":
            return(o.renderMode);

        case "lengthScale":
            return(o.lengthScale);

        case "velocityScale":
            return(o.velocityScale);

        case "cameraVelocityScale":
            return(o.cameraVelocityScale);

        case "normalDirection":
            return(o.normalDirection);

        case "alignment":
            return(o.alignment);

        case "pivot":
            return(o.pivot);

        case "sortMode":
            return(o.sortMode);

        case "sortingFudge":
            return(o.sortingFudge);

        case "minParticleSize":
            return(o.minParticleSize);

        case "maxParticleSize":
            return(o.maxParticleSize);

        case "mesh":
            return(o.mesh);

        case "meshCount":
            return(o.meshCount);

        case "transform":
            return(o.transform);

        case "gameObject":
            return(o.gameObject);

        case "tag":
            return(o.tag);
        }
        LBoot.LogUtil.Error("UnityEngine.ParticleSystemRenderer no Getter Found : " + propertyName);
        return(null);
    }
Ejemplo n.º 14
0
 static public int get_normalDirection(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         pushValue(l, self.normalDirection);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 15
0
 static public int get_cameraVelocityScale(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         pushValue(l, self.cameraVelocityScale);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 16
0
	static public int get_maskInteraction(IntPtr l) {
		try {
			UnityEngine.ParticleSystemRenderer self=(UnityEngine.ParticleSystemRenderer)checkSelf(l);
			pushValue(l,true);
			pushEnum(l,(int)self.maskInteraction);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Ejemplo n.º 17
0
 static public int get_activeVertexStreamsCount(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         pushValue(l, self.activeVertexStreamsCount);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 18
0
	static public int get_meshCount(IntPtr l) {
		try {
			UnityEngine.ParticleSystemRenderer self=(UnityEngine.ParticleSystemRenderer)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.meshCount);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Ejemplo n.º 19
0
    // Use this for initialization
    void Start()
    {
        activateDenPartSysCol = this.gameObject.GetComponent<CircleCollider2D> ();

        DenParticleSysGO = this.gameObject.transform.parent.gameObject;
            //Find ("WolfDen Particle Sys").gameObject;
        DenParticleSys = DenParticleSysGO.GetComponent<ParticleSystem> ();
        DenParticleSysRend = DenParticleSysGO.GetComponent<ParticleSystemRenderer> ();
        DenParticleSys.enableEmission = false;
        DenParticleSysRend.enabled = false;
    }
Ejemplo n.º 20
0
 static public int get_renderMode(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         pushEnum(l, (int)self.renderMode);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 21
0
 static public int get_trailMaterial(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         pushValue(l, self.trailMaterial);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_velocityScale(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         pushValue(l, self.velocityScale);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int get_lengthScale(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.lengthScale);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_alignment(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         pushValue(l, true);
         pushEnum(l, (int)self.alignment);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 25
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer o;
         o = new UnityEngine.ParticleSystemRenderer();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.ParticleSystemRenderer o;
			o=new UnityEngine.ParticleSystemRenderer();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Ejemplo n.º 27
0
 static public int set_alignment(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer    self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         UnityEngine.ParticleSystemRenderSpace v;
         checkEnum(l, 2, out v);
         self.alignment = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 28
0
 static public int set_pivot(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         UnityEngine.Vector3 v;
         checkType(l, 2, out v);
         self.pivot = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 29
0
 static public int set_sortMode(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         UnityEngine.ParticleSystemSortMode v;
         checkEnum(l, 2, out v);
         self.sortMode = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 30
0
 static public int GetActiveVertexStreams(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         System.Collections.Generic.List <UnityEngine.ParticleSystemVertexStream> a1;
         checkType(l, 2, out a1);
         self.GetActiveVertexStreams(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer o;
         o=new UnityEngine.ParticleSystemRenderer();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
Ejemplo n.º 32
0
 static public int set_trailMaterial(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         UnityEngine.Material v;
         checkType(l, 2, out v);
         self.trailMaterial = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 33
0
 static public int set_maxParticleSize(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         float v;
         checkType(l, 2, out v);
         self.maxParticleSize = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 34
0
 static public int set_maskInteraction(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer self = (UnityEngine.ParticleSystemRenderer)checkSelf(l);
         UnityEngine.SpriteMaskInteraction  v;
         checkEnum(l, 2, out v);
         self.maskInteraction = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 35
0
 static public int constructor(IntPtr l)
 {
     LuaDLL.lua_remove(l, 1);
     UnityEngine.ParticleSystemRenderer o;
     if (matchType(l, 1))
     {
         o = new UnityEngine.ParticleSystemRenderer();
         pushObject(l, o);
         return(1);
     }
     LuaDLL.luaL_error(l, "New object failed.");
     return(0);
 }
Ejemplo n.º 36
0
	static public int set_mesh(IntPtr l) {
		try {
			UnityEngine.ParticleSystemRenderer self=(UnityEngine.ParticleSystemRenderer)checkSelf(l);
			UnityEngine.Mesh v;
			checkType(l,2,out v);
			self.mesh=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystemRenderer o;
         o = new UnityEngine.ParticleSystemRenderer();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Ejemplo n.º 38
0
 // Use this for initialization
 void Start()
 {
     gs = GameObject.Find ("GameStates").GetComponent<GameStates> ();
     renderer = gameObject.GetComponent<ParticleSystemRenderer> ();
 }
	public ParticleState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
		: base( owner, obj )
	{
		m_particleSystem = m_obj.GetComponent<ParticleSystem>();
		m_meshRenderer = m_particleSystem.GetComponent<Renderer>().GetComponent<ParticleSystemRenderer>();
	}
	public void Start () {
		particleSystemRenderer2 = gameObject.particleSystem.renderer as ParticleSystemRenderer;
		if (PlaygroundC.reference!=null) {
			if (!PlaygroundC.reference.particleSystems.Contains(this))
				PlaygroundC.reference.particleSystems.Add(this);
			if (particleSystemTransform.parent==null && PlaygroundC.reference.autoGroup)
				particleSystemTransform.parent = PlaygroundC.referenceTransform;
		}

		if (particleSystemGameObject.activeSelf)
			StartCoroutine(YieldedRefresh());
	}
	void OnEnable () {

		lastActiveTool = Tools.current;
		isEditingInHierarchy = Selection.activeTransform!=null;

		// Load settings
		playgroundSettings = PlaygroundSettingsC.GetReference();
		
		// Load language
		playgroundLanguage = PlaygroundSettingsC.GetLanguage();
		
		// Playground Particles
		playgroundParticlesScriptReference = target as PlaygroundParticlesC;
		if (playgroundParticlesScriptReference==null) return;
		playgroundParticles = new SerializedObject(playgroundParticlesScriptReference);
		
		shurikenRenderer = playgroundParticlesScriptReference.particleSystemGameObject.GetComponent<ParticleSystem>().GetComponent<Renderer>() as ParticleSystemRenderer;

		// Sorting layers
		Type internalEditorUtilityType = typeof(InternalEditorUtility);
		PropertyInfo sortingLayersProperty = internalEditorUtilityType.GetProperty("sortingLayerNames", BindingFlags.Static | BindingFlags.NonPublic);
		rendererSortingLayers = (string[])sortingLayersProperty.GetValue(null, new object[0]);
		for (int i = 0; i<rendererSortingLayers.Length; i++) {
			if (shurikenRenderer.sortingLayerName == rendererSortingLayers[i])
				selectedSortingLayer = i;
		}

		// UV Module (Texture Sheet Animation)
		shuriken = new SerializedObject(playgroundParticlesScriptReference.shurikenParticleSystem);
		uvModule = shuriken.FindProperty("UVModule");
		uvModule_enabled = uvModule.FindPropertyRelative("enabled");
		uvModule_frameOverTime_scalar = uvModule.FindPropertyRelative("frameOverTime.scalar");
		uvModule_frameOverTime_minCurve = uvModule.FindPropertyRelative("frameOverTime.minCurve");
		uvModule_frameOverTime_maxCurve = uvModule.FindPropertyRelative("frameOverTime.maxCurve");
		uvModule_frameOverTime_minMaxState = uvModule.FindPropertyRelative("frameOverTime.minMaxState");
		uvModule_tilesX = uvModule.FindPropertyRelative("tilesX");
		uvModule_tilesY = uvModule.FindPropertyRelative("tilesY");
		uvModule_animationType = uvModule.FindPropertyRelative("animationType");
		uvModule_rowIndex = uvModule.FindPropertyRelative("rowIndex");
		uvModule_cycles = uvModule.FindPropertyRelative("cycles");
		uvModule_randomRow = uvModule.FindPropertyRelative("randomRow");
		uv_animationType = (AnimationType)uvModule_animationType.intValue;
		uv_minMaxState = (MinMaxState)uvModule_frameOverTime_minMaxState.intValue;


		shurikenRendererSO = new SerializedObject(shurikenRenderer);
		sortingMode = shurikenRendererSO.FindProperty("m_SortMode");
		sortingFudge = shurikenRendererSO.FindProperty("m_SortingFudge");
		sortMode = (SortMode)sortingMode.intValue;

		manipulators = playgroundParticles.FindProperty("manipulators");
		events = playgroundParticles.FindProperty("events");
		snapshots = playgroundParticles.FindProperty("snapshots");
		source = playgroundParticles.FindProperty("source");
		sorting = playgroundParticles.FindProperty("sorting");
		lifetimeSorting = playgroundParticles.FindProperty("lifetimeSorting");
		activeState = playgroundParticles.FindProperty("activeState");
		particleCount = playgroundParticles.FindProperty("particleCount");
		emissionRate = playgroundParticles.FindProperty("emissionRate");
		updateRate = playgroundParticles.FindProperty("updateRate");
		emit = playgroundParticles.FindProperty("emit");
		loop = playgroundParticles.FindProperty("loop");
		disableOnDone = playgroundParticles.FindProperty("disableOnDone");
		disableOnDoneRoutine = playgroundParticles.FindProperty("disableOnDoneRoutine");
		calculate = playgroundParticles.FindProperty("calculate");
		deltaMovementStrength = playgroundParticles.FindProperty("deltaMovementStrength");
		particleTimescale = playgroundParticles.FindProperty("particleTimescale");
		sizeMin = playgroundParticles.FindProperty("sizeMin");
		sizeMax = playgroundParticles.FindProperty("sizeMax");
		overflowOffset = playgroundParticles.FindProperty("overflowOffset");
		overflowMode = playgroundParticles.FindProperty("overflowMode");
		lifetime = playgroundParticles.FindProperty("lifetime");
		lifetimeSize = playgroundParticles.FindProperty("lifetimeSize");
		arraySize = playgroundParticles.FindProperty("particleArraySize");
		turbulenceLifetimeStrength = playgroundParticles.FindProperty("turbulenceLifetimeStrength");
		lifetimeVelocity = playgroundParticles.FindProperty("lifetimeVelocity");
		initialVelocityShape = playgroundParticles.FindProperty("initialVelocityShape");
		initialVelocityMin = playgroundParticles.FindProperty("initialVelocityMin");
		initialVelocityMax = playgroundParticles.FindProperty("initialVelocityMax");
		initialLocalVelocityMin = playgroundParticles.FindProperty("initialLocalVelocityMin");
		initialLocalVelocityMax = playgroundParticles.FindProperty("initialLocalVelocityMax");
		lifetimeColor = playgroundParticles.FindProperty("lifetimeColor");
		lifetimeColors = playgroundParticles.FindProperty ("lifetimeColors");
		arrayColor = playgroundParticles.FindProperty("arrayColorAlpha");
		colorSource = playgroundParticles.FindProperty("colorSource");
		collision = playgroundParticles.FindProperty("collision");
		affectRigidbodies = playgroundParticles.FindProperty("affectRigidbodies");
		mass = playgroundParticles.FindProperty("mass");
		collisionRadius = playgroundParticles.FindProperty("collisionRadius");
		collisionMask = playgroundParticles.FindProperty("collisionMask");
		collisionType = playgroundParticles.FindProperty("collisionType");
		bounciness = playgroundParticles.FindProperty("bounciness");
		states = playgroundParticles.FindProperty("states");
		worldObject = playgroundParticles.FindProperty("worldObject");
		skinnedWorldObject = playgroundParticles.FindProperty("skinnedWorldObject");
		forceSkinnedMeshUpdateOnMainThread = playgroundParticles.FindProperty ("forceSkinnedMeshUpdateOnMainThread");
		sourceTransform = playgroundParticles.FindProperty("sourceTransform");
		worldObjectUpdateVertices = playgroundParticles.FindProperty ("worldObjectUpdateVertices");
		worldObjectUpdateNormals = playgroundParticles.FindProperty("worldObjectUpdateNormals");
		sourcePaint = playgroundParticles.FindProperty("paint");
		sourceProjection = playgroundParticles.FindProperty("projection");
		sourceSplines = playgroundParticles.FindProperty("splines");
		sourceTransforms = playgroundParticles.FindProperty("sourceTransforms");
		lifetimeStretching = playgroundParticles.FindProperty("stretchLifetime");
		threadMethod = playgroundParticles.FindProperty("threadMethod");

		playgroundParticlesScriptReference.shurikenParticleSystem = playgroundParticlesScriptReference.GetComponent<ParticleSystem>();
		playgroundParticlesScriptReference.particleSystemRenderer = playgroundParticlesScriptReference.shurikenParticleSystem.GetComponent<Renderer>();
		particleMaterial = playgroundParticlesScriptReference.particleSystemRenderer.sharedMaterial;
		
		onlySourcePositioning = playgroundParticles.FindProperty("onlySourcePositioning");

		lifetimePositioning = playgroundParticles.FindProperty("lifetimePositioning");
		lifetimePositioningX = lifetimePositioning.FindPropertyRelative("x");
		lifetimePositioningY = lifetimePositioning.FindPropertyRelative("y");
		lifetimePositioningZ = lifetimePositioning.FindPropertyRelative("z");
		lifetimePositioningTimeScale = playgroundParticles.FindProperty ("lifetimePositioningTimeScale");
		lifetimePositioningPositionScale = playgroundParticles.FindProperty ("lifetimePositioningPositionScale");

		applyLifetimeVelocity = playgroundParticles.FindProperty("applyLifetimeVelocity");
		lifeTimeVelocityX = lifetimeVelocity.FindPropertyRelative("x");
		lifeTimeVelocityY = lifetimeVelocity.FindPropertyRelative("y");
		lifeTimeVelocityZ = lifetimeVelocity.FindPropertyRelative("z");
		
		initialVelocityShapeX = initialVelocityShape.FindPropertyRelative("x");
		initialVelocityShapeY = initialVelocityShape.FindPropertyRelative("y");
		initialVelocityShapeZ = initialVelocityShape.FindPropertyRelative("z");
		
		applyInitialVelocity = playgroundParticles.FindProperty("applyInitialVelocity");
		applyInitialLocalVelocity = playgroundParticles.FindProperty("applyInitialLocalVelocity");
		applyVelocityBending = playgroundParticles.FindProperty("applyVelocityBending");
		velocityBendingType = playgroundParticles.FindProperty("velocityBendingType");

		movementCompensationLifetimeStrength = playgroundParticles.FindProperty ("movementCompensationLifetimeStrength");
		
		worldObjectGameObject = worldObject.FindPropertyRelative("gameObject");
		skinnedWorldObjectGameObject = skinnedWorldObject.FindPropertyRelative("gameObject");

		// Lifetime colors
		if (playgroundParticlesScriptReference.lifetimeColors==null)
			playgroundParticlesScriptReference.lifetimeColors = new List<PlaygroundGradientC>();

		// Sorting
		prevLifetimeSortingKeys = playgroundParticlesScriptReference.lifetimeSorting.keys;

		// Events list
		eventListFoldout = new List<bool>();
		eventListFoldout.AddRange(new bool[playgroundParticlesScriptReference.events.Count]);

		// States foldout
		statesListFoldout = new List<bool>();
		statesListFoldout.AddRange(new bool[playgroundParticlesScriptReference.states.Count]);

		previousSource = playgroundParticlesScriptReference.source;
		
		// Playground
		playgroundScriptReference = FindObjectOfType<PlaygroundC>();
		
		
		// Create a manager if no existing instance is in the scene
		if (!playgroundScriptReference && Selection.activeTransform!=null) {
			PlaygroundC.ResourceInstantiate("Playground Manager");
			playgroundScriptReference = FindObjectOfType<PlaygroundC>();
		}
		
		if (playgroundScriptReference!=null) {

			PlaygroundC.reference = playgroundScriptReference;

			// Serialize Playground
			playground = new SerializedObject(playgroundScriptReference);
			
			PlaygroundInspectorC.Initialize(playgroundScriptReference);
			
			
			// Add this PlaygroundParticles if not existing in Playground list
			if (!playgroundParticlesScriptReference.isSnapshot && !playgroundScriptReference.particleSystems.Contains(playgroundParticlesScriptReference) && Selection.activeTransform!=null)
				playgroundScriptReference.particleSystems.Add(playgroundParticlesScriptReference);
				
			// Cache components
			playgroundParticlesScriptReference.particleSystemGameObject = playgroundParticlesScriptReference.gameObject;
			playgroundParticlesScriptReference.particleSystemTransform = playgroundParticlesScriptReference.transform;
			playgroundParticlesScriptReference.particleSystemRenderer = playgroundParticlesScriptReference.GetComponent<Renderer>();
			playgroundParticlesScriptReference.shurikenParticleSystem = playgroundParticlesScriptReference.particleSystemGameObject.GetComponent<ParticleSystem>();
			playgroundParticlesScriptReference.particleSystemRenderer2 = playgroundParticlesScriptReference.particleSystemGameObject.GetComponent<ParticleSystem>().GetComponent<Renderer>() as ParticleSystemRenderer;
			
			// Set manager as parent 
			//if (PlaygroundC.reference.autoGroup && playgroundParticlesScriptReference.particleSystemTransform!=null && playgroundParticlesScriptReference.particleSystemTransform.parent == null && Selection.activeTransform!=null)
			//	playgroundParticlesScriptReference.particleSystemTransform.parent = PlaygroundC.referenceTransform;
			
			// Issue a quick refresh

			if (!EditorApplication.isPlaying && isEditingInHierarchy) {
				foreach (PlaygroundParticlesC p in PlaygroundC.reference.particleSystems) {
					p.Start();
				}
			}
		}

		selectedSort = sorting.intValue;

		// State initial values
		if (addStateTransform==null)
			addStateTransform = (Transform)playgroundParticlesScriptReference.particleSystemTransform;
		
		// Visiblity of Shuriken component in Inspector
		if (!playgroundScriptReference || playgroundScriptReference && !playgroundScriptReference.showShuriken)
			playgroundParticlesScriptReference.shurikenParticleSystem.hideFlags = HideFlags.HideInInspector;
		else
			playgroundParticlesScriptReference.shurikenParticleSystem.hideFlags = HideFlags.None;

		SetWireframeVisibility();

		// Set paint init
		paintLayerMask = sourcePaint.FindPropertyRelative("layerMask");
		paintCollisionType = sourcePaint.FindPropertyRelative("collisionType");
		
		// Set projection init
		projectionMask = sourceProjection.FindPropertyRelative("projectionMask");
		projectionCollisionType = sourceProjection.FindPropertyRelative("collisionType");

		// Snapshots
		if (playgroundParticlesScriptReference.snapshots.Count>0) {
			if (playgroundParticlesScriptReference.snapshots.Count>0) {
				for (int i = 0; i<playgroundParticlesScriptReference.snapshots.Count; i++)
					if (playgroundParticlesScriptReference.snapshots[i].settings==null)
						playgroundParticlesScriptReference.snapshots.RemoveAt(i);
			}
			saveName += " "+(playgroundParticlesScriptReference.snapshots.Count+1).ToString();
		}

		SetMissingKeys();
	}
Ejemplo n.º 42
0
 void Start()
 {
     targetSystem = GetComponent<ParticleSystem>();
     targetRenderer = targetSystem.GetComponent<ParticleSystemRenderer>();
     targetRenderer.enabled = false;
 }
    public PersistentKSPShurikenEmitter(
        GameObject go,
        ParticleSystem pe,
        ParticleSystemRenderer pr,
        KSPParticleEmitter templateKspParticleEmitter)
    {
        this.go = go;
        this.pe = pe;
        this.pr = pr;

        // TODO That s what we need to also save to emit manually with proper values

        // float emitterVelocityScale
        // Vector3 rndVelocity
        // bool rndRotation
        // float angularVelocity
        // float rndAngularVelocity

        //templateKspParticleEmitter.ve

        shape = templateKspParticleEmitter.shape;

        scale1DBase = shape1D = templateKspParticleEmitter.shape1D;
        scale2DBase = shape2D = templateKspParticleEmitter.shape2D;
        scale3DBase = shape3D = templateKspParticleEmitter.shape3D;

        minEmissionBase = minEmission = templateKspParticleEmitter.minEmission;
        maxEmissionBase = maxEmission = templateKspParticleEmitter.maxEmission;
        minEnergyBase = minEnergy = templateKspParticleEmitter.minEnergy;
        maxEnergyBase = maxEnergy = templateKspParticleEmitter.maxEnergy;

        minSizeBase = minSize = templateKspParticleEmitter.minSize;
        maxSizeBase = maxSize = templateKspParticleEmitter.maxSize;

        localVelocityBase = localVelocity = templateKspParticleEmitter.localVelocity;
        worldVelocityBase = worldVelocity = templateKspParticleEmitter.worldVelocity;

        forceBase = force = templateKspParticleEmitter.force;
        rndForce = templateKspParticleEmitter.rndForce;

        rndVelocity = templateKspParticleEmitter.rndVelocity;
        rndRotation = templateKspParticleEmitter.rndRotation;
        angularVelocity = templateKspParticleEmitter.angularVelocity;
        rndAngularVelocity = templateKspParticleEmitter.rndAngularVelocity;

        // Unity sure love its strange way of using struct (this actually works because each properties of the struct does magic)
        ParticleSystem.ForceOverLifetimeModule fol = pe.forceOverLifetime;
        fol.enabled = force.sqrMagnitude > 0 || rndForce.sqrMagnitude > 0;
        fol.x = new ParticleSystem.MinMaxCurve(forceBase.x, forceBase.x + rndForce.x);
        fol.y = new ParticleSystem.MinMaxCurve(forceBase.y, forceBase.y + rndForce.y);
        fol.z = new ParticleSystem.MinMaxCurve(forceBase.z, forceBase.z + rndForce.z);

        color = templateKspParticleEmitter.color;

        PersistentEmitterManager.Add(this);
    }
Ejemplo n.º 44
0
 // Check all needed references
 void CheckReferences()
 {
     if (PlaygroundC.reference==null)
         PlaygroundC.reference = FindObjectOfType<PlaygroundC>();
     if (PlaygroundC.reference==null) {
         PlaygroundC.reference = PlaygroundC.ResourceInstantiate("Playground Manager").GetComponent<PlaygroundC>();
     }
     if (playgroundCache==null)
         playgroundCache = new PlaygroundCache();
     if (thisInstance==null)
         thisInstance = this;
     if (particleSystemGameObject==null) {
         particleSystemGameObject = gameObject;
         particleSystemTransform = transform;
         particleSystemRenderer = GetComponent<Renderer>();
         shurikenParticleSystem = particleSystemGameObject.GetComponent<ParticleSystem>();
         particleSystemRenderer2 = gameObject.GetComponent<ParticleSystem>().GetComponent<Renderer>() as ParticleSystemRenderer;
     }
 }
    static int _CreateParticleSystemRenderer(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            ParticleSystemRenderer obj = new ParticleSystemRenderer();
            LuaScriptMgr.Push(L, obj);
            return 1;
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: ParticleSystemRenderer.New");
        }

        return 0;
    }
        public SGenericParticleSystem(ParticleSystem system, ParticleSystemRenderer renderer, ParticleSystem.Particle[] particles, int particleCount)
        {
            if (system == null || renderer == null)
                return;

            instanceID = system.GetInstanceID();
            goInstanceID = system.gameObject.GetInstanceID();
            isLegacy = false;
            isWorldSpace = system.simulationSpace == ParticleSystemSimulationSpace.World;
            emit = system.enableEmission;
            enabled = renderer.enabled;
            position = system.transform.position;
            name = system.gameObject.name;
            SetParticleRenderer(renderer);

            this.particles = new SGenericParticleArray(particles, particleCount);
        }
Ejemplo n.º 47
0
    void Start()
    {
        if(Camera.main.GetComponent<AudioReverbZone>())
        {
            reverbZone = Camera.main.GetComponent<AudioReverbZone>();
        }
        spiritParticlesR = Camera.main.GetComponentInChildren<ParticleSystemRenderer>();
        sPRColorStart = spiritParticlesR.material.GetColor("_TintColor");
        spiritParticlesR.material.SetColor("_TintColor", new Color(sPRColorStart.r, sPRColorStart.g, sPRColorStart.b, 0));
        //		RenderSettings.ambientLight = new Color(1,1,1);
        startAmbientL = RenderSettings.ambientLight;
        spiritObj = GameObject.Find("Spirit");
        playerController = playerObj.GetComponent<CharacterController>();
        playerVelocity = playerController.velocity;
        playerMove = playerObj.GetComponent<PlayerMovement>();

        spiritMove = spiritObj.GetComponent<SpiritMovement>();
        spiritGfx = spiritObj.transform.GetChild(0).gameObject;
        spiritGfxMesh = spiritGfx.transform.GetChild(0).gameObject;

        spiritMove.activeMovement = false;
        //		spiritObj.renderer.enabled = false;
        spiritObj.GetComponent<Collider>().enabled = false;
        spiritGfx.SetActive(false);
        charMesh = transform.GetChild(0).transform.GetChild(0);
        dir = -1;
        switchable =true;
    }
Ejemplo n.º 48
0
 // Use this for initialization
 void Start()
 {
     m_Render = GetComponent<ParticleSystemRenderer>();
 }
	void OnEnable () {

		lastActiveTool = Tools.current;
		
		// Playground Particles
		playgroundParticlesScriptReference = target as PlaygroundParticlesC;
		playgroundParticles = new SerializedObject(playgroundParticlesScriptReference);
		
		shurikenRenderer = playgroundParticlesScriptReference.particleSystemGameObject.particleSystem.renderer as ParticleSystemRenderer;
		
		manipulators = playgroundParticles.FindProperty("manipulators");
		events = playgroundParticles.FindProperty("events");
		snapshots = playgroundParticles.FindProperty("snapshots");
		source = playgroundParticles.FindProperty("source");
		sorting = playgroundParticles.FindProperty("sorting");
		lifetimeSorting = playgroundParticles.FindProperty("lifetimeSorting");
		nearestNeighborOrigin = playgroundParticles.FindProperty("nearestNeighborOrigin");
		activeState = playgroundParticles.FindProperty("activeState");
		particleCount = playgroundParticles.FindProperty("particleCount");
		emissionRate = playgroundParticles.FindProperty("emissionRate");
		updateRate = playgroundParticles.FindProperty("updateRate");
		emit = playgroundParticles.FindProperty("emit");
		loop = playgroundParticles.FindProperty("loop");
		disableOnDone = playgroundParticles.FindProperty("disableOnDone");
		calculate = playgroundParticles.FindProperty("calculate");
		deltaMovementStrength = playgroundParticles.FindProperty("deltaMovementStrength");
		particleTimescale = playgroundParticles.FindProperty("particleTimescale");
		sizeMin = playgroundParticles.FindProperty("sizeMin");
		sizeMax = playgroundParticles.FindProperty("sizeMax");
		overflowOffset = playgroundParticles.FindProperty("overflowOffset");
		overflowMode = playgroundParticles.FindProperty("overflowMode");
		lifetime = playgroundParticles.FindProperty("lifetime");
		lifetimeSize = playgroundParticles.FindProperty("lifetimeSize");
		turbulenceLifetimeStrength = playgroundParticles.FindProperty("turbulenceLifetimeStrength");
		lifetimeVelocity = playgroundParticles.FindProperty("lifetimeVelocity");
		initialVelocityShape = playgroundParticles.FindProperty("initialVelocityShape");
		initialVelocityMin = playgroundParticles.FindProperty("initialVelocityMin");
		initialVelocityMax = playgroundParticles.FindProperty("initialVelocityMax");
		initialLocalVelocityMin = playgroundParticles.FindProperty("initialLocalVelocityMin");
		initialLocalVelocityMax = playgroundParticles.FindProperty("initialLocalVelocityMax");
		lifetimeColor = playgroundParticles.FindProperty("lifetimeColor");
		lifetimeColors = playgroundParticles.FindProperty ("lifetimeColors");
		colorSource = playgroundParticles.FindProperty("colorSource");
		collision = playgroundParticles.FindProperty("collision");
		affectRigidbodies = playgroundParticles.FindProperty("affectRigidbodies");
		mass = playgroundParticles.FindProperty("mass");
		collisionRadius = playgroundParticles.FindProperty("collisionRadius");
		collisionMask = playgroundParticles.FindProperty("collisionMask");
		collisionType = playgroundParticles.FindProperty("collisionType");
		bounciness = playgroundParticles.FindProperty("bounciness");
		states = playgroundParticles.FindProperty("states");
		worldObject = playgroundParticles.FindProperty("worldObject");
		skinnedWorldObject = playgroundParticles.FindProperty("skinnedWorldObject");
		sourceTransform = playgroundParticles.FindProperty("sourceTransform");
		worldObjectUpdateVertices = playgroundParticles.FindProperty ("worldObjectUpdateVertices");
		worldObjectUpdateNormals = playgroundParticles.FindProperty("worldObjectUpdateNormals");
		sourcePaint = playgroundParticles.FindProperty("paint");
		sourceProjection = playgroundParticles.FindProperty("projection");
		lifetimeStretching = playgroundParticles.FindProperty("stretchLifetime");

		playgroundParticlesScriptReference.shurikenParticleSystem = playgroundParticlesScriptReference.GetComponent<ParticleSystem>();
		playgroundParticlesScriptReference.particleSystemRenderer = playgroundParticlesScriptReference.shurikenParticleSystem.renderer;
		particleMaterial = playgroundParticlesScriptReference.particleSystemRenderer.sharedMaterial;
		
		onlySourcePositioning = playgroundParticles.FindProperty("onlySourcePositioning");
		
		applyLifetimeVelocity = playgroundParticles.FindProperty("applyLifetimeVelocity");
		lifeTimeVelocityX = lifetimeVelocity.FindPropertyRelative("x");
		lifeTimeVelocityY = lifetimeVelocity.FindPropertyRelative("y");
		lifeTimeVelocityZ = lifetimeVelocity.FindPropertyRelative("z");
		
		initialVelocityShapeX = initialVelocityShape.FindPropertyRelative("x");
		initialVelocityShapeY = initialVelocityShape.FindPropertyRelative("y");
		initialVelocityShapeZ = initialVelocityShape.FindPropertyRelative("z");
		
		applyInitialVelocity = playgroundParticles.FindProperty("applyInitialVelocity");
		applyInitialLocalVelocity = playgroundParticles.FindProperty("applyInitialLocalVelocity");
		applyVelocityBending = playgroundParticles.FindProperty("applyVelocityBending");
		velocityBendingType = playgroundParticles.FindProperty("velocityBendingType");

		movementCompensationLifetimeStrength = playgroundParticles.FindProperty ("movementCompensationLifetimeStrength");
		
		worldObjectGameObject = worldObject.FindPropertyRelative("gameObject");
		skinnedWorldObjectGameObject = skinnedWorldObject.FindPropertyRelative("gameObject");

		// Lifetime colors
		if (playgroundParticlesScriptReference.lifetimeColors==null)
			playgroundParticlesScriptReference.lifetimeColors = new List<PlaygroundGradientC>();

		// Sorting
		prevLifetimeSortingKeys = playgroundParticlesScriptReference.lifetimeSorting.keys;
		
		// Manipulator list
		manipulatorListFoldout = new List<bool>();
		manipulatorListFoldout.AddRange(new bool[playgroundParticlesScriptReference.manipulators.Count]);

		// Events list
		eventListFoldout = new List<bool>();
		eventListFoldout.AddRange(new bool[playgroundParticlesScriptReference.events.Count]);

		// States foldout
		statesListFoldout = new List<bool>();
		statesListFoldout.AddRange(new bool[playgroundParticlesScriptReference.states.Count]);

		previousSource = playgroundParticlesScriptReference.source;
		
		// Playground
		playgroundScriptReference = FindObjectOfType<PlaygroundC>();
		
		
		// Create a manager if no existing instance is in the scene
		if (!playgroundScriptReference && Selection.activeTransform!=null) {
			PlaygroundC.ResourceInstantiate("Playground Manager");
			playgroundScriptReference = FindObjectOfType<PlaygroundC>();
		}
		
		if (playgroundScriptReference!=null) {
			PlaygroundC.reference = playgroundScriptReference;

			// Serialize Playground
			playground = new SerializedObject(playgroundScriptReference);
			
			PlaygroundInspectorC.Initialize(playgroundScriptReference);
			
			
			// Add this PlaygroundParticles if not existing in Playground list
			if (!playgroundParticlesScriptReference.isSnapshot && !playgroundScriptReference.particleSystems.Contains(playgroundParticlesScriptReference) && Selection.activeTransform!=null)
				playgroundScriptReference.particleSystems.Add(playgroundParticlesScriptReference);
				
			// Cache components
			playgroundParticlesScriptReference.particleSystemGameObject = playgroundParticlesScriptReference.gameObject;
			playgroundParticlesScriptReference.particleSystemTransform = playgroundParticlesScriptReference.transform;
			playgroundParticlesScriptReference.particleSystemRenderer = playgroundParticlesScriptReference.renderer;
			playgroundParticlesScriptReference.shurikenParticleSystem = playgroundParticlesScriptReference.particleSystemGameObject.GetComponent<ParticleSystem>();
			playgroundParticlesScriptReference.particleSystemRenderer2 = playgroundParticlesScriptReference.particleSystemGameObject.particleSystem.renderer as ParticleSystemRenderer;
			
			// Set manager as parent 
			if (PlaygroundC.reference.autoGroup && playgroundParticlesScriptReference.particleSystemTransform!=null && playgroundParticlesScriptReference.particleSystemTransform.parent == null && Selection.activeTransform!=null)
				playgroundParticlesScriptReference.particleSystemTransform.parent = PlaygroundC.referenceTransform;
			
			// Issue a quick refresh
			if (!EditorApplication.isPlaying)
				foreach (PlaygroundParticlesC p in PlaygroundC.reference.particleSystems)
					p.Start();
		}

		selectedSort = sorting.intValue;

		// State initial values
		if (addStateTransform==null)
			addStateTransform = (Transform)playgroundParticlesScriptReference.particleSystemTransform;
		
		// Visiblity of Shuriken component in Inspector
		if (!playgroundScriptReference || playgroundScriptReference && !playgroundScriptReference.showShuriken)
			playgroundParticlesScriptReference.shurikenParticleSystem.hideFlags = HideFlags.HideInInspector;
		else
			playgroundParticlesScriptReference.shurikenParticleSystem.hideFlags = HideFlags.None;

		SetWireframeVisibility();

		// Set paint init
		paintLayerMask = sourcePaint.FindPropertyRelative("layerMask");
		paintCollisionType = sourcePaint.FindPropertyRelative("collisionType");
		
		LoadBrushes();
		
		// Set projection init
		projectionMask = sourceProjection.FindPropertyRelative("projectionMask");
		projectionCollisionType = sourceProjection.FindPropertyRelative("collisionType");

		// Snapshots
		if (playgroundParticlesScriptReference.snapshots.Count>0) {
			if (playgroundParticlesScriptReference.snapshots.Count>0) {
				for (int i = 0; i<playgroundParticlesScriptReference.snapshots.Count; i++)
					if (playgroundParticlesScriptReference.snapshots[i].settings==null)
						playgroundParticlesScriptReference.snapshots.RemoveAt(i);
			}
			saveName += " "+(playgroundParticlesScriptReference.snapshots.Count+1).ToString();
		}
	}
Ejemplo n.º 50
0
 void Start()
 {
     if(lifeTime != -1)
         destroyTime = Time.time + lifeTime;
     if (!Collider)
         Collider = GetComponent<Collider> ();
     Collider.enabled = false;
     if (!FX)
         FX = GetComponentInChildren<ParticleSystemRenderer> ();
     if (damageInfo == null)
         damageInfo = new Item_Weapon ("DoT Area", 600, 670, 0, 0, 0.5f);
 }
        private void SetParticleRenderer(ParticleSystemRenderer renderer)
        {
            if (renderer == null)
                return;

            this.renderer = new SParticleRenderer();
            SetMainCamPos();

            switch (renderer.renderMode) {
                case ParticleSystemRenderMode.Billboard: this.renderer.renderMode = SParticleRenderMode.Billboard; break;
                case ParticleSystemRenderMode.HorizontalBillboard: this.renderer.renderMode = SParticleRenderMode.HorizontalBillboard; break;
                case ParticleSystemRenderMode.Mesh: this.renderer.renderMode = SParticleRenderMode.Mesh; break;
                case ParticleSystemRenderMode.Stretch: this.renderer.renderMode = SParticleRenderMode.Stretch; break;
                case ParticleSystemRenderMode.VerticalBillboard: this.renderer.renderMode = SParticleRenderMode.VerticalBillboard; break;
            }

            this.renderer.cameraVelocityScale = renderer.cameraVelocityScale;
            this.renderer.lengthScale = renderer.lengthScale;
            this.renderer.velocityScale = renderer.velocityScale;
        }
Ejemplo n.º 52
0
	void Start(){
		ps = GetComponent<ParticleSystemRenderer>();
		ps.material.renderQueue =3500;
		tr = GetComponent<Transform>();
	}
Ejemplo n.º 53
0
 private void Start()
 {
     particleRenderer = GetComponent<ParticleSystemRenderer>();
     auxRenderer = GetComponent<Renderer>();
 }
Ejemplo n.º 54
0
 private void Awake()
 {
     m_cachedTransform = transform;
     m_particleRenderer = GetComponent<ParticleSystemRenderer>();
 }