// activate/deactivate the character when going into the store. The GUIManager will manage the preview public void ShowStore(bool show) { // ensure the correct character is used if (!show) { SpawnCharacter(); } InfiniteRunnerStarterPackUtility.ActiveRecursively(character.transform, !show); }
public virtual void Activate() { if (optimizeDeactivation) { for (int i = 0; i < childRenderers.Length; ++i) { childRenderers[i].enabled = transform; } for (int i = 0; i < childColliders.Length; ++i) { childColliders[i].enabled = transform; } enabled = true; } else { InfiniteRunnerStarterPackUtility.ActiveRecursively(thisTransform, true); } }
public virtual void Deactivate() { if (destroyOnDeactivation) { // don't destroy the collision particle effect ParticleSystem[] particleSystems = GetComponentsInChildren <ParticleSystem>(); if (PlayerController.instance) { ParticleSystem collisionParticleSystem = PlayerController.instance.collisionParticleSystem; for (int i = 0; i < particleSystems.Length; ++i) { if (particleSystems[i] == collisionParticleSystem) { particleSystems[i].transform.parent = null; } } } Destroy(gameObject); return; } thisTransform.parent = startParent; infiniteObjectParent = null; if (optimizeDeactivation) { foreach (Renderer child in childRenderers) { child.enabled = false; } foreach (Collider child in childColliders) { child.enabled = false; } enabled = false; } else { InfiniteRunnerStarterPackUtility.ActiveRecursively(thisTransform, false); } }