public override void InitializeAgent() { base.InitializeAgent(); //agentRenderer = GetComponentInChildren; rayPer = GetComponent <RayPerception>(); academy = FindObjectOfType <ANNSoccerAcademy>(); PlayerState playerState = new PlayerState(); playerState.agentRB = GetComponent <Rigidbody>(); agentRB = GetComponent <Rigidbody>(); agentRB.maxAngularVelocity = 400f; playerState.startingPos = transform.position; playerState.agentScript = this; area.playerStates.Add(playerState); playerIndex = area.playerStates.IndexOf(playerState); playerState.playerIndex = playerIndex; }
void Awake() { academy = FindObjectOfType <ANNSoccerAcademy>(); groundRenderer = centerPitch.GetComponent <Renderer>(); groundMaterial = groundRenderer.material; canResetBall = true; if (goalTextUI) { goalTextUI.SetActive(false); } if (hud) { hud.SetActive(true); } ballRB = ball.GetComponent <Rigidbody>(); ballController = ball.GetComponent <ANNSoccerBallController>(); ballController.area = this; ballStartingPos = ball.transform.position; Mesh mesh = ground.GetComponent <MeshFilter>().mesh; scoreRed = 0; scoreBlue = 0; }