// Update is called once per frame void Update() { if (GetComponent <FlappyAIController>() != null) { return; } if (Input.GetKeyDown(_key)) { _controller.Jump(); } }
// Update is called once per frame void FixedUpdate() { _normalizedHeight = GetNormalizedAltitude(); _normalizedDistance = GetNormalizedDistanceToObstacle(); _normalizedObsAltitude = GetNormalizedAltitudeOfObstacle(); if (_controller.IsDead) { return; } if (Think()) { _controller.Jump(); } }