void Start() { gameObject.layer = LayerMask.NameToLayer(Settings.Instance().gameEntityTag); controller = gameObject.GetComponent <NpcEntityController>(); controller.agent = controller.gameObject.AddComponent <NavMeshAgent>(); controller.agent.updateRotation = false; controller.agent.angularSpeed = 600f; controller.useNavmesh = true; Type type = Type.GetType("LandRush.DefaultCombatAi"); if (type != null) { combatAi = gameObject.AddComponent(type) as CombatAi; } InvokeRepeating("RunAi", 0.01f, NpcManager.instance.npcUpdateInterval); }
void Start() { gameObject.layer = LayerMask.NameToLayer(Settings.Instance().gameEntityTag); controller = gameObject.GetComponent<NpcEntityController>(); controller.agent = controller.gameObject.AddComponent<NavMeshAgent>(); controller.agent.updateRotation = false; controller.agent.angularSpeed = 600f; controller.useNavmesh = true; Type type = Type.GetType("LandRush.DefaultCombatAi"); if (type != null) { combatAi = gameObject.AddComponent(type) as CombatAi; } InvokeRepeating("RunAi", 0.01f, NpcManager.instance.npcUpdateInterval); }