public void init() { infiniteObjectGenerator = InfiniteObjectGenerator.instance; powerUpManager = PowerUpManager.instance; gameManager = GameManager.instance; projectionCamerasController = ProjectionCamerasController.instance; projectionPortalWindowsController = ProjectionPortalWindowsController.instance; // mainCameraController = MainCameraController.instance; platformLayer = LayerMask.NameToLayer("Platform"); wallLayer = LayerMask.NameToLayer("Wall"); obstacleLayer = LayerMask.NameToLayer("Obstacle"); thisTransform = transform; thisRigidbody = rigidbody; capsuleCollider = GetComponent <CapsuleCollider>(); playerAnimation = GetComponent <PlayerAnimation>(); playerAnimation.init(); startPosition = thisTransform.position; startRotation = thisTransform.rotation; slideData = new CoroutineData(); forwardSpeeds.init(); // make sure the coin magnet trigger is deactivated activatePowerUp(PowerUpTypes.CoinMagnet, false, Color.white); reset(); enabled = false; // zorbModeActive = false; }
void Awake() { instance = this; }