Exemplo n.º 1
0
 /// <summary>
 /// Copies this PlaygroundCache.
 /// </summary>
 public PlaygroundCache Clone()
 {
     PlaygroundCache playgroundCache = new PlaygroundCache();
     playgroundCache.initialSize = initialSize.Clone() as float[];
     playgroundCache.size = size.Clone () as float[];
     playgroundCache.life = life.Clone() as float[];
     playgroundCache.lifetimeSubtraction = lifetimeSubtraction.Clone() as float[];
     playgroundCache.rotation = rotation.Clone() as float[];
     playgroundCache.birth = birth.Clone() as float[];
     playgroundCache.birthDelay = birthDelay.Clone() as float[];
     playgroundCache.death = death.Clone() as float[];
     playgroundCache.emission = emission.Clone() as bool[];
     playgroundCache.rebirth = rebirth.Clone() as bool[];
     playgroundCache.lifetimeOffset = lifetimeOffset.Clone() as float[];
     playgroundCache.velocity = velocity.Clone() as Vector3[];
     playgroundCache.initialVelocity = initialVelocity.Clone() as Vector3[];
     playgroundCache.initialLocalVelocity = initialLocalVelocity.Clone() as Vector3[];
     playgroundCache.position = position.Clone () as Vector3[];
     playgroundCache.targetPosition = targetPosition.Clone() as Vector3[];
     playgroundCache.targetDirection = targetDirection.Clone() as Vector3[];
     playgroundCache.previousTargetPosition = previousTargetPosition.Clone() as Vector3[];
     playgroundCache.previousParticlePosition = previousParticlePosition.Clone() as Vector3[];
     playgroundCache.collisionParticlePosition = collisionParticlePosition.Clone () as Vector3[];
     playgroundCache.localSpaceMovementCompensation = localSpaceMovementCompensation.Clone() as Vector3[];
     playgroundCache.scatterPosition = scatterPosition.Clone() as Vector3[];
     playgroundCache.initialRotation = initialRotation.Clone() as float[];
     playgroundCache.rotationSpeed = rotationSpeed.Clone() as float[];
     playgroundCache.color = color.Clone() as Color32[];
     playgroundCache.scriptedColor = scriptedColor.Clone() as Color32[];
     playgroundCache.initialColor = initialColor.Clone () as Color32[];
     playgroundCache.lifetimeColorId = lifetimeColorId.Clone () as int[];
     playgroundCache.noForce = noForce.Clone() as bool[];
     playgroundCache.changedByProperty = changedByProperty.Clone() as bool[];
     playgroundCache.changedByPropertyColor = changedByPropertyColor.Clone() as bool[];
     playgroundCache.changedByPropertyColorLerp = changedByPropertyColorLerp.Clone() as bool[];
     playgroundCache.changedByPropertyColorKeepAlpha = changedByPropertyColorKeepAlpha.Clone () as bool[];
     playgroundCache.changedByPropertySize = changedByPropertySize.Clone() as bool[];
     playgroundCache.changedByPropertyTarget = changedByPropertyTarget.Clone() as bool[];
     playgroundCache.changedByPropertyDeath = changedByPropertyDeath.Clone() as bool[];
     playgroundCache.propertyTarget = propertyTarget.Clone() as int[];
     playgroundCache.propertyId = propertyId.Clone() as int[];
     playgroundCache.excludeFromManipulatorId = excludeFromManipulatorId.Clone() as int[];
     playgroundCache.propertyColorId = propertyColorId.Clone() as int[];
     playgroundCache.manipulatorId = manipulatorId.Clone() as int[];
     playgroundCache.isMasked = isMasked.Clone() as bool[];
     playgroundCache.maskAlpha = maskAlpha.Clone() as float[];
     if (maskSorting!=null) playgroundCache.maskSorting = maskSorting.Clone() as int[];
     playgroundCache.isNonBirthed = isNonBirthed.Clone() as bool[];
     playgroundCache.isFirstLoop = isFirstLoop.Clone() as bool[];
     playgroundCache.simulate = simulate.Clone() as bool[];
     playgroundCache.isCalculatedThisFrame = isCalculatedThisFrame.Clone() as bool[];
     return playgroundCache;
 }
Exemplo n.º 2
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;
     }
 }
		[HideInInspector] public float[] maskAlpha;									// The alpha of this masked particle
		
		// Copy this PlaygroundCache
		public PlaygroundCache Clone () {
			PlaygroundCache playgroundCache = new PlaygroundCache();
			playgroundCache.initialSize = initialSize.Clone() as float[];
			playgroundCache.size = size.Clone () as float[];
			playgroundCache.life = life.Clone() as float[];
			playgroundCache.rotation = rotation.Clone() as float[];
			playgroundCache.birth = birth.Clone() as float[];
			playgroundCache.birthDelay = birthDelay.Clone() as float[];
			playgroundCache.death = death.Clone() as float[];
			playgroundCache.emission = emission.Clone() as bool[];
			playgroundCache.rebirth = rebirth.Clone() as bool[];
			playgroundCache.lifetimeOffset = lifetimeOffset.Clone() as float[];
			playgroundCache.velocity = velocity.Clone() as Vector3[];
			playgroundCache.initialVelocity = initialVelocity.Clone() as Vector3[];
			playgroundCache.initialLocalVelocity = initialLocalVelocity.Clone() as Vector3[];
			playgroundCache.position = position.Clone () as Vector3[];
			playgroundCache.targetPosition = targetPosition.Clone() as Vector3[];
			playgroundCache.targetDirection = targetDirection.Clone() as Vector3[];
			playgroundCache.previousTargetPosition = previousTargetPosition.Clone() as Vector3[];
			playgroundCache.previousParticlePosition = previousParticlePosition.Clone() as Vector3[];
			playgroundCache.collisionParticlePosition = collisionParticlePosition.Clone () as Vector3[];
			playgroundCache.localSpaceMovementCompensation = localSpaceMovementCompensation.Clone() as Vector3[];
			playgroundCache.scatterPosition = scatterPosition.Clone() as Vector3[];
			playgroundCache.initialRotation = initialRotation.Clone() as float[];
			playgroundCache.rotationSpeed = rotationSpeed.Clone() as float[];
			playgroundCache.color = color.Clone() as Color32[];
			playgroundCache.scriptedColor = scriptedColor.Clone() as Color32[];
			playgroundCache.initialColor = initialColor.Clone () as Color32[];
			playgroundCache.lifetimeColorId = lifetimeColorId.Clone () as int[];
			playgroundCache.changedByProperty = changedByProperty.Clone() as bool[];
			playgroundCache.changedByPropertyColor = changedByPropertyColor.Clone() as bool[];
			playgroundCache.changedByPropertyColorLerp = changedByPropertyColorLerp.Clone() as bool[];
			playgroundCache.changedByPropertyColorKeepAlpha = changedByPropertyColorKeepAlpha.Clone () as bool[];
			playgroundCache.changedByPropertySize = changedByPropertySize.Clone() as bool[];
			playgroundCache.changedByPropertyTarget = changedByPropertyTarget.Clone() as bool[];
			playgroundCache.changedByPropertyDeath = changedByPropertyDeath.Clone() as bool[];
			playgroundCache.propertyTarget = propertyTarget.Clone() as int[];
			playgroundCache.propertyId = propertyId.Clone() as int[];
			playgroundCache.propertyColorId = propertyColorId.Clone() as int[];
			playgroundCache.isMasked = isMasked.Clone() as bool[];
			playgroundCache.maskAlpha = maskAlpha.Clone() as float[];
			return playgroundCache;
		}