public void RespawnAgent(GameObject agent) { LandSpawnArea sa = agent.GetComponentInParent <LandSpawnArea>(); if (sa != null) { sa.RespawnNPC(agent); } }
public override void AgentReset() { wood = 0; currentMode = AgentMode.exploring; currentGatherReward = startGatherReward; agentRB.velocity = Vector3.zero; // Agent position reset was managed by the Academy, now moved to LandSpawnArea //myAcademy.RespawnAgent(gameObject); myArea.RespawnNPC(gameObject); }