Ejemplo n.º 1
0
 void OnWizardCreate()
 {
     if (group == null && Selection.activeGameObject != null)
     {
         group = Selection.activeGameObject.GetComponent <SceneNPCGroup> ();
     }
     MapEventActionManager.CreateNewGroupAction(Selection.activeGameObject, group);
 }
Ejemplo n.º 2
0
    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;
    }
Ejemplo n.º 3
0
 protected override void OnUpdate()
 {
     if (group != null)
     {
         objPath = MapEventHelper.GetGameObjectPath(group.transform);
     }
     else if (objPath != null)
     {
         group = GameObject.Find(objPath).GetComponent <SceneNPCGroup> ();
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
    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;
    }
Ejemplo n.º 6
0
 public static void RemoveNPCGroup(SceneNPCGroup group)
 {
     GameObject.DestroyImmediate(group.gameObject);
     _isUpdated = true;
 }