private void OnEnable() { if (instance == null) { instance = this; } else { Destroy(this.gameObject); } gamePlane = GameObject.Find("Gameplay Plane"); planeComp = gamePlane.GetComponentInChildren <PlaneMovement>(); movementComp = gamePlane.GetComponentInChildren <PlayerMovement>(); deathComp = gamePlane.GetComponentInChildren <PlayerDeath>(); obstacleComp = gamePlane.GetComponentInChildren <ObstaclePlacementState>(); followComp = gamePlane.GetComponentInChildren <PlayerFollowTarget>(); progressObstacle = Resources.Load <GameObject>("ProgressionObstacle"); endObstacle = Resources.Load <GameObject>("CompletionObstacle"); whiteFade = GameObject.Find("WhiteFade"); whiteFadeColor = whiteFade.GetComponentInChildren <Image>().color; whiteFadeColor.a = 0f; }
private void OnEnable() { movementComp = GetComponentInChildren <PlayerMovement>(); followComp = GetComponentInChildren <PlayerFollowTarget>(); speedMultiplier = 0.5f; }