/// <summary> /// 创建npc携程 /// </summary> /// <returns></returns> private IEnumerator CreatureCreatures() { if (m_EditorCreature != null && m_EditorCreature.Length > 0) { for (int iCreature = 0; iCreature < m_EditorCreature.Length; iCreature++) { GameObject creatureObj = new GameObject(); creatureObj.transform.SetParent(transform); Creature creature = creatureObj.AddComponent <Creature>(); creature.Init(m_EditorCreature[iCreature]); EditorTeleport teleport = GetTeleport(creature.m_Uid); if (teleport != null) { BindTeleport bindTeleport = creatureObj.AddComponent <BindTeleport>(); if (bindTeleport != null) { bindTeleport.m_TeleportId = teleport.teleportId; } } if (iCreature % 5 == 0) { yield return(null); } } } yield return(null); }
public int GetBindTeleportId() { BindTeleport bindTeleport = GetComponent <BindTeleport>(); if (bindTeleport != null) { return(bindTeleport.m_TeleportId); } return(0); }
private void OnEnable() { m_Target = target as BindTeleport; }