Exemplo n.º 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);
    }
Exemplo n.º 2
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);
        }
    }
Exemplo n.º 3
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);
        }
    }