void Start() { BallLauncher.OnLaunch += UpdatePlayersOnHit; // Listen for any hits from other bots or player BotPass.OnBallHit += UpdatePlayersOnHit; PassPlatform.OnBallHit += UpdatePlayersOnHit; Hand.OnBallHit += UpdatePlayersOnHit; PlayerSetter.OnBallSet += UpdatePlayersOnHit; passTargets = GameObject.FindGameObjectWithTag(managerTag).GetComponentInChildren <BotPassTargets>(); destinations = GameObject.FindGameObjectWithTag(managerTag).GetComponentInChildren <BotDestinations>(); }
void Start() { botPlayer = GetComponent <BotPlayer>(); botHeight = GetComponent <CapsuleCollider>().height; botRadius = GetComponent <CapsuleCollider>().radius; rb = GetComponent <Rigidbody>(); controller = GetComponent <CharacterController>(); maxJumpHeight = GetMaxJumpHeight(); timeToMaxJumpHeight = GetTimeToMaxJumpHeight(); destinations = GameObject.FindGameObjectWithTag(botPlayer.managerTag).GetComponentInChildren <BotDestinations>(); Ball.OnOutOfPlay += MoveToServeRecieve; }