private void OnDisable() { if (GoapWorldManager.GetInstance()) { GoapWorldManager.GetInstance().RemoveObject(this); } }
public override void InitPlanning(GoapPlanner.PlanningData _planningData) { base.InitPlanning(_planningData); objectTarget = GoapWorldManager.GetInstance().QueryClosestObjectWithID(queryObjectsID, objectTag, _planningData.agentPositonXZ, out sqrDistanceToTarget); objectTag = queryObjectTag.GetHashCode(); }
private void OnEnable() { GoapWorldManager.GetInstance().AddObject(this); positionCache = this.transform.position; positionCacheXZ = Shared.MathUtil.GetVectorXZ(positionCache); }