public virtual void InitializePathAgent() { if (pathAgent == null) { pathAgent = new NavAgent(this); pathAgent.SetPathType(PathType.Ground); pathAgent.SetPosition(position); } }