void OnTriggerExit2D(Collider2D other) { if (other.gameObject.tag == "Player") { foreach (GameObject platform in rotatingPlatforms) { RotatingPlatform myScript = platform.gameObject.GetComponent <RotatingPlatform>(); myScript.enabled = false; } } }
void Awake() { m_StartPosition = transform.position; m_InitialMovement = m_SmoothMovement; // activate doors m_DoorController = GetComponent <DoorController>(); // active sounds m_PlatformSoundFX = GetComponent <PlatformSoundFX>(); m_RotatingPlatform = GetComponent <RotatingPlatform>(); }
private void Awake() { startPosition = transform.position; initialMovement = smoothMovement; // activate doors doorController = GetComponent <DoorController>(); // add sound soundFX = GetComponent <PlatformSoundFX>(); if (activateRotation) { rotatePlatform = GetComponent <RotatingPlatform>(); } }
private void Awake() { rotatingPlatform = GetComponentInParent <RotatingPlatform>(); }
void Awake() { m_RotatingPlatform = GetComponentInParent <RotatingPlatform>(); m_SoundFX = GetComponent <PlatformSoundFX>(); }