void Awake() { m_PushBlockSettings = FindObjectOfType <PushBlockWithInputSettings>(); LazyInitializeActions(); // Cache the agent rigidbody m_PlayerRb = GetComponent <Rigidbody>(); }
void Awake() { m_PushBlockSettings = FindObjectOfType <PushBlockWithInputSettings>(); goalDetect = block.GetComponent <GoalDetectWithInput>(); goalDetect.agent = this; // Cache the agent rigidbody m_AgentRb = GetComponent <Rigidbody>(); // Cache the block rigidbody m_BlockRb = block.GetComponent <Rigidbody>(); // Get the ground's bounds areaBounds = ground.GetComponent <Collider>().bounds; // Get the ground renderer so we can change the material when a goal is scored m_GroundRenderer = ground.GetComponent <Renderer>(); // Starting material m_GroundMaterial = m_GroundRenderer.material; }