Exemple #1
0
    public void OnCreateAction(GameObject ActionEmpty)
    {
        Transform storyTransform = ContainerControllerBase.GetStoryTransform();

        //print("--OnCreateAction2 " + storyTransform);
        if (storyTransform != null)
        {
            SetPrefabName(Instantiate(ActionEmpty, storyTransform) as GameObject);
        }
        //ContainerController.current.Draw();
        EditorEventManager.TriggerEvent("Draw_" + ContainerControllerBase.currentContainerController.name);
    }
Exemple #2
0
    public void OnEndDrag(PointerEventData eventData)
    {
        if (isDrag)
        {
            isDrag = false;
            EventPanel eventPanel = eventData.pointerEnter.GetComponent <EventPanel>();
            if (eventPanel != null)
            {
                RandomEventController randomEventController = storyTransform.GetComponent <RandomEventController>();
                if (randomEventController == null)
                {
                    randomEventController = storyTransform.gameObject.AddComponent <RandomEventController>();
                }

                randomEventController.randomEventList.Add(eventPanel.generalEvent);
                //ContainerController.current.Draw();
                EditorEventManager.TriggerEvent("Draw_" + ContainerControllerBase.currentContainerController.name);
            }
        }
    }
Exemple #3
0
    public void OnDelete()
    {
        Transform storyTransform = ContainerControllerBase.GetStoryTransform();

        if (storyTransform != null)
        {
            GeneralEvent generalEvent = storyTransform.GetComponent <GeneralEvent>();
            if (generalEvent != null)
            {
                foreach (RandomEventController randomEventController in container2.currentEditorBaseItem.storyTransform.GetComponentsInChildren <RandomEventController>())
                {
                    randomEventController.randomEventList.Remove(generalEvent);
                }
            }
            ReAttachRandomEventControllerLinks(storyTransform);
            //Destroy(storyTransform.gameObject);
            DestroyImmediate(storyTransform.gameObject);
            ContainerControllerBase.currentContainerController.currentEditorBaseItem = null;
            //ContainerController.current.Draw();
            EditorEventManager.TriggerEvent("RemoveItem_" + ContainerControllerBase.currentContainerController.name);
        }
    }
Exemple #4
0
    public void OnCreateEvent(GameObject EventEmptyPrefab)
    {
        Transform storyTransform = ContainerControllerBase.GetStoryTransform();

        if (storyTransform != null)
        {
            GameObject go = Instantiate(EventEmptyPrefab, storyTransform) as GameObject;
            SetEventPrefabName(go);

            if (storyTransform.GetComponent <Action>() != null)
            {
                RandomEventController randomEventController = storyTransform.GetComponent <RandomEventController>();
                if (randomEventController == null)
                {
                    randomEventController = storyTransform.gameObject.AddComponent <RandomEventController>();
                }

                randomEventController.randomEventList.Add(go.GetComponent <GeneralEvent>());
            }
            //ContainerController.current.Draw();
            EditorEventManager.TriggerEvent("Draw_" + ContainerControllerBase.currentContainerController.name);
        }
    }
Exemple #5
0
 public virtual void DoAction <T>(T go)
 {
     EditorEventManager.TriggerEvent(eventName, go);
 }
Exemple #6
0
 public virtual void DoAction(Transform go)
 {
     EditorEventManager.TriggerEvent(eventName, go);
 }
Exemple #7
0
//	public virtual void DoAction()
//	{
//		EditorEventManager.TriggerEvent(eventName);
//	}

    public virtual void DoAction(GameObject go)
    {
        //print(go);
        EditorEventManager.TriggerEvent(eventName, go);
    }