ManipulatorObjectC manipulator; // Cached manipulator void Start() { // Get the manipulator from the particle system manipulator = PlaygroundC.GetManipulator(manipulatorNumber, particles); // Set all protected particles within specified ranges from protectedParticles SetProtectedParticles(); }
// private float m_Multiplier; public void Awake() { m_Sprite = transform.GetComponentInChildren <SpriteRenderer>(); m_LineRenderer = transform.GetComponentInChildren <LineRenderer>(); m_Particles = transform.GetComponentInChildren <PlaygroundParticlesC>(); m_ManipulatorTransform = m_Particles.transform.FindChild("Manipulator"); m_ManipulatorObstruction = PlaygroundC.GetManipulator(0, m_Particles); m_ManipulatorColor = PlaygroundC.GetManipulator(1, m_Particles); }
ManipulatorObjectC manipulator; // Cached version of maipulator void Start() { // Set Cache if (localManipulator) { manipulator = PlaygroundC.GetManipulator(manipulatorNumber, particles); } else { manipulator = PlaygroundC.GetManipulator(manipulatorNumber); } }
public virtual void Awake() { m_PigmentCircle = transform.FindChild("Pigment Circle").GetComponent <SpriteRenderer>(); m_PigmentRing = transform.FindChild("Pigment Ring").GetComponent <SpriteRenderer>(); m_CromaticRing = transform.FindChild("Cromatic Ring").GetComponent <SpriteRenderer>(); m_Raycast = transform.FindChild("Raycast"); m_Particles = m_Raycast.GetComponentInChildren <PlaygroundParticlesC>(); m_ManipulatorTransform = m_Particles.transform.FindChild("Manipulator"); m_LineRenderer = m_Raycast.GetComponentInChildren <LineRenderer>(); m_Output = m_Raycast.GetComponentInChildren <SpriteRenderer>(); m_ManipulatorObstruction = PlaygroundC.GetManipulator(0, m_Particles); m_ManipulatorColor = PlaygroundC.GetManipulator(1, m_Particles); m_ParticleRing = GetComponentInChildren <ParticleSystem>(); m_SoundSource = GetComponent <AudioSource>(); }
void OnEnable() { if (_manipulator == null) { _manipulator = PlaygroundC.GetManipulator(manipulatorIndex, particles); } // Sanity check _targetPosition = target.position; _manipulator.particleEventEnter -= Teleport; // Enable the Manipulator _manipulator.enabled = true; // Assign to the event delegate of when a particle is entering the Manipulator _manipulator.particleEventEnter += Teleport; }
void Start() { // Mouse cursor not wanted #if UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2 Screen.showCursor = false; #else Cursor.visible = false; #endif // Make sure particle systems are inactive foreach (PlaygroundFxCycleItem p in particleFx) { p.particles.emit = false; p.particles.particleSystemGameObject.SetActive(false); } // Set initial skybox values skyboxColorOnLoad = RenderSettings.skybox.GetColor("_Tint"); RenderSettings.skybox.SetColor("_Tint", Color.black); // Cache up! cam = Camera.main; camTransform = cam.transform; camFov = cam.fieldOfView; repellentManipulator = PlaygroundC.GetManipulator(0); repellentManipulator.enabled = false; particleBlastClips = particleBlastSound.GetComponent <SoundFxArray>().sounds; // Set initial camera values camPivot.position = camSpline.GetPoint(0f); camRotation.rotation = Quaternion.LookRotation(-camRotation.position); // Run the intro StartCoroutine(FadeIn()); // Get started right away if no user interaction is required if (isSelfRunning) { pressSpaceText.SetActive(false); StartCoroutine(Selfrunning()); } }
int pickups = 0; // As an example count the amount of pickups made void Start() { // Cache the Local Manipulator manipulator = PlaygroundC.GetManipulator(manipulatorIndex, particles); // Note that you can set the Manipulator to Type: None in case you have no intention to also modify the particles behavior // manipulator.type = MANIPULATORTYPEC.None; // Make sure we're tracking particles manipulator.trackParticles = true; // Make sure we're sending enter events manipulator.sendEventEnter = true; // Make sure we're using the fastest tracking method manipulator.trackingMethod = TrackingMethod.ManipulatorId; // Assign your function to the event delegate manipulator.particleEventEnter += OnManipulatorEnter; }
public void Awake() { switch (type) { case PipeType.Entry: // m_Particles = GetComponentInChildren<PlaygroundParticlesC>(); theSprite.color = new Color(0, 0, 0, 0); break; case PipeType.Exit: m_Raycast = transform.FindChild("Raycast"); m_LineRenderer = m_Raycast.GetComponentInChildren <LineRenderer>(); m_Particles = GetComponentInChildren <PlaygroundParticlesC>(); m_ManipulatorTransform = m_Particles.transform.FindChild("Manipulator"); m_ManipulatorObstruction = PlaygroundC.GetManipulator(0, m_Particles); m_ManipulatorColor = PlaygroundC.GetManipulator(1, m_Particles); break; } }
public void Awake() { m_RaycastLeft = transform.FindChild("RaycastLeft"); m_RaycastRight = transform.FindChild("RaycastRight"); m_LineRendererLeft = m_RaycastLeft.GetComponentInChildren <LineRenderer>(); m_LineRendererRight = m_RaycastRight.GetComponentInChildren <LineRenderer>(); m_ParticleLeft = m_RaycastLeft.GetComponentInChildren <PlaygroundParticlesC>(); m_ParticleRight = m_RaycastRight.GetComponentInChildren <PlaygroundParticlesC>(); m_ManipulatorLeft = m_ParticleLeft.transform.FindChild("Manipulator"); m_ManipulatorRight = m_ParticleRight.transform.FindChild("Manipulator"); m_ManipulatorObstuctionLeft = PlaygroundC.GetManipulator(0, m_ParticleLeft); m_ManipulatorObstuctionRight = PlaygroundC.GetManipulator(0, m_ParticleRight); m_ManipulatorColorLeft = PlaygroundC.GetManipulator(1, m_ParticleLeft); m_ManipulatorColorRight = PlaygroundC.GetManipulator(1, m_ParticleRight); }
int highestPop; // Keep track of highest pop void Start() { // Cache the manipulator of bubbleParticles (at list position 0) manipulator = PlaygroundC.GetManipulator(0, bubbleParticles); // Cache the manipulator transform, this looks a bit awkward at first, however the transform of a // manipulator is a thread-safe wrapper class which has a variable containing the Transform component. // In this example scene manipulatorTransform = transform; is the same. manipulatorTransform = manipulator.transform.transform; // Hook up functions to the Event Delegates on the manipulator manipulator.particleEventEnter += OnManipulatorEnter; manipulator.particleEventExit += OnManipulatorExit; manipulator.particleEventBirth += OnManipulatorBirth; manipulator.particleEventDeath += OnManipulatorDeath; manipulator.particleEventCollision += OnManipulatorCollision; mainCamera = Camera.main; popTextColor = popText.color; InvokeRepeating("UpdateGUI", 0, guiUpdateTime); }
void Start() { globalManipulator = PlaygroundC.GetManipulator(0); }
// Use this for initialization void Start() { manipulator = PlaygroundC.GetManipulator(0, GetComponent <PlaygroundParticlesC>()); }