private void CreateNavSearchAgent() { if (base.actor.isMovable) { Seeker component = base.gameObject.GetComponent <Seeker>(); if (component == null) { component = base.gameObject.AddComponent <Seeker>(); } FunnelModifier modifier = base.gameObject.GetComponent <FunnelModifier>(); if (modifier == null) { modifier = base.gameObject.AddComponent <FunnelModifier>(); } component.startEndModifier.Priority = 3; modifier.Priority = 2; if ((base.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) || (base.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)) { RVOController controller = base.gameObject.GetComponent <RVOController>(); if (controller == null) { controller = base.gameObject.AddComponent <RVOController>(); } controller.maxSpeed = this.maxSpeed; controller.enabled = true; controller.EnsureActorAndSimulator(); } } }
private void CreateNavSearchAgent() { if (!this.actor.isMovable) { return; } Seeker seeker = base.gameObject.GetComponent <Seeker>(); if (!seeker) { seeker = base.gameObject.AddComponent <Seeker>(); } FunnelModifier funnelModifier = base.gameObject.GetComponent <FunnelModifier>(); if (!funnelModifier) { funnelModifier = base.gameObject.AddComponent <FunnelModifier>(); } seeker.startEndModifier.Priority = 3; funnelModifier.Priority = 2; if (this.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster || this.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) { RVOController rVOController = base.gameObject.GetComponent <RVOController>(); if (!rVOController) { rVOController = base.gameObject.AddComponent <RVOController>(); } rVOController.maxSpeed = this.maxSpeed; rVOController.enabled = true; rVOController.EnsureActorAndSimulator(); } }
void CreateNavAgent() { var actorShowObj = ActorTransform.gameObject; seeker = actorShowObj.getOrAddComponent <Seeker>(); fmodifier = actorShowObj.getOrAddComponent <FunnelModifier>(); controller = actorShowObj.getOrAddComponent <RVOController>(); controller.center = new Int3(0, 1600, 0); Position = (Int3) new Vector3(0, 13, -41); controller.EnsureActorAndSimulator(); }