void Start() { objectVision = GetComponent<ObjectVision> (); jumpSlerpObject = GetComponent<JumpSlerpObject> (); rotateObject = GetComponent<RotateObject> (); int startDir = Random.Range (1, 30); currentDirection = startDir >= 15 ? JumperDirection.left : JumperDirection.right; }
// Use this for initialization void Start() { rigidBody = GetComponent<Rigidbody> (); audioSource = GetComponent<AudioSource> (); jumpSlerpObject = GetComponent<JumpSlerpObject> (); rotateObject = GetComponent<RotateObject> (); objectVision = GetComponent<ObjectVision> (); jumpSlerpObject.OnJumpSlerpEnded += OnJumpEnded; rotateObject.OnRotationEnded += OnRotateEnded; rotateObject.OnRotationStarted += OnRotateStarted; animator = GetComponent<Animator> (); isDead = false; }