void OnWizardCreate() { if (group == null && Selection.activeGameObject != null) { group = Selection.activeGameObject.GetComponent <SceneNPCGroup> (); } MapEventActionManager.CreateNewGroupAction(Selection.activeGameObject, group); }
public static void CreateNewGroupAction(GameObject target, SceneNPCGroup group) { var action = CreateAction <GenerateNewGroupAction> (target, Example.MapEventAction.Type.OPEN_NPC_GROUP, null); action.group = group; Selection.activeGameObject = action.gameObject; }
protected override void OnUpdate() { if (group != null) { objPath = MapEventHelper.GetGameObjectPath(group.transform); } else if (objPath != null) { group = GameObject.Find(objPath).GetComponent <SceneNPCGroup> (); } }
protected override void OnUpdate() { if (group != null) { objPath = MapEventHelper.GetGameObjectPath(group.transform); groupid = group.groupId; } else if (!string.IsNullOrEmpty(objPath)) { group = GameObject.Find(objPath).GetComponent <SceneNPCGroup> (); } else { group = FindGroup(groupid); } }
public static void CreateNPCWave(SceneNPCGroup group, int delayTime) { int sequene = group.transform.childCount + 1; var go = new GameObject("波次-" + sequene); var wave = go.AddComponent <SceneNPCWave>(); wave.waveSequence = sequene; wave.delayTime = delayTime; go.transform.SetParent(group.transform); go.transform.position = selectionPosition; go.transform.localScale = Vector3.one; go.transform.rotation = Quaternion.identity; _isUpdated = true; Selection.activeGameObject = go; }
public static void RemoveNPCGroup(SceneNPCGroup group) { GameObject.DestroyImmediate(group.gameObject); _isUpdated = true; }