protected override void OnLoad(ConfigNode configNode)
        {
            base.OnLoad(configNode);

            cutSceneDefinition = new CutSceneDefinition();
            cutSceneDefinition.OnLoad(configNode.GetNode("CUTSCENE_DEFINITION"));
        }
        public override bool Load(ConfigNode configNode)
        {
            // Load base class
            bool valid = base.Load(configNode);

            valid &= ConfigNodeUtil.ParseValue<TriggeredBehaviour.State>(configNode, "onState", x => onState = x, this, TriggeredBehaviour.State.PARAMETER_COMPLETED);
            if (onState == TriggeredBehaviour.State.PARAMETER_COMPLETED || onState == TriggeredBehaviour.State.PARAMETER_FAILED)
            {
                valid &= ConfigNodeUtil.ParseValue<List<string>>(configNode, "parameter", x => parameter = x, this, new List<string>());
            }

            if (ConfigNodeUtil.ParseValue<string>(configNode, "cutSceneFileURL", x => cutSceneFileURL = x, this, Validation.ValidateFileURL))
            {
                cutSceneDefinition = new CutSceneDefinition();
                cutSceneDefinition.Load(cutSceneFileURL);
            }
            else
            {
                valid = false;
            }

            return valid;
        }
        private void WindowGUI(int windowID)
        {
            // TODO - real loading
            if (currentCutScene == null)
            {
                currentCutScene = new CutSceneDefinition();
                currentCutScene.Load("ContractConfigurator/CutScene/CameraTestCutScene.cfg");
            }

            GUILayout.BeginHorizontal();

            const int LIST_WIDTH = 500;
            GUILayout.BeginVertical(GUILayout.Width(LIST_WIDTH));

            // The different modes
            GUILayout.BeginHorizontal();
            if (GUILayout.Toggle(currentMode == Modes.Camera, "Cameras", toggleCenteredStyle))
            {
                if (currentMode != Modes.Camera)
                {
                    currentMode = Modes.Camera;
                    scrollPosition = new Vector2(0, 0);
                    currentItem = currentCamera;
                }
            }
            if (GUILayout.Toggle(currentMode == Modes.Actor, "Actors", toggleCenteredStyle))
            {
                if (currentMode != Modes.Actor)
                {
                    currentMode = Modes.Actor;
                    scrollPosition = new Vector2(0, 0);
                    currentItem = currentActor;
                }
            }
            if (GUILayout.Toggle(currentMode == Modes.Action, "Actions", toggleCenteredStyle))
            {
                if (currentMode != Modes.Action)
                {
                    currentMode = Modes.Action;
                    scrollPosition = new Vector2(0, 0);
                    currentItem = currentAction;
                }
            }
            GUILayout.EndHorizontal();

            // Display the listing of entities
            scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, true, GUILayout.Height(LIST_HEIGHT));
            int currentIndex = -1;
            int i = 0;
            int listCount = 0;

            // Display the listing of cameras
            if (currentMode == Modes.Camera)
            {
                listCount = currentCutScene.cameras.Count;
                foreach (CutSceneCamera camera in currentCutScene.cameras)
                {
                    if (currentCamera == camera)
                    {
                        currentIndex = i;
                    }
                    i++;

                    GUILayout.BeginHorizontal();
                    if (GUILayout.Toggle(camera == currentCamera, camera.FullDescription(), toggleStyle, GUILayout.Width(LIST_WIDTH - 36)))
                    {
                        currentCamera = camera;
                        currentItem = camera;
                    }
                    GUILayout.EndHorizontal();
                }
            }
            // Display the listing of actors
            else if (currentMode == Modes.Actor)
            {
                listCount = currentCutScene.actors.Count;
                foreach (Actor actor in currentCutScene.actors)
                {
                    if (currentActor == actor)
                    {
                        currentIndex = i;
                    }
                    i++;

                    GUILayout.BeginHorizontal();
                    if (GUILayout.Toggle(actor == currentActor, actor.FullDescription(), toggleStyle, GUILayout.Width(LIST_WIDTH - 36)))
                    {
                        currentActor = actor;
                        currentItem = actor;
                    }
                    GUILayout.EndHorizontal();
                }
            }
            // Display the listing of cut scene actions
            else if (currentMode == Modes.Action)
            {
                listCount = currentCutScene.actions.Count;
                foreach (CutSceneAction action in currentCutScene.actions)
                {
                    if (currentAction == action)
                    {
                        currentIndex = i;
                    }
                    i++;

                    GUILayout.BeginHorizontal();
                    if (GUILayout.Toggle(action == currentAction, action.FullDescription(), toggleStyle, GUILayout.Width(LIST_WIDTH - 72)))
                    {
                        currentAction = action;
                        currentItem = action;
                    }
                    GUILayout.BeginVertical();
                    GUILayout.Space(3);
                    action.async = GUILayout.Toggle(action.async, new GUIContent("", "If checked, moves to the next action before waiting for this one to complete."));
                    GUILayout.EndVertical();
                    GUILayout.EndHorizontal();
                }
            }
            GUILayout.EndScrollView();

            GUILayout.BeginHorizontal();
            GUILayout.Button("New");
            if (GUILayout.Button("Up") && currentIndex > 0)
            {
                if (currentMode == Modes.Actor)
                {
                    currentCutScene.actors[currentIndex] = currentCutScene.actors[currentIndex - 1];
                    currentCutScene.actors[currentIndex - 1] = currentActor;
                }
                else if (currentMode == Modes.Camera)
                {
                    currentCutScene.cameras[currentIndex] = currentCutScene.cameras[currentIndex - 1];
                    currentCutScene.cameras[currentIndex - 1] = currentCamera;
                }
                else
                {
                    currentCutScene.actions[currentIndex] = currentCutScene.actions[currentIndex - 1];
                    currentCutScene.actions[currentIndex - 1] = currentAction;
                }
            }
            if (GUILayout.Button("Down") && currentIndex != -1 && currentIndex != listCount - 1)
            {
                if (currentMode == Modes.Actor)
                {
                    currentCutScene.actors[currentIndex] = currentCutScene.actors[currentIndex + 1];
                    currentCutScene.actors[currentIndex + 1] = currentActor;
                }
                else if (currentMode == Modes.Camera)
                {
                    currentCutScene.cameras[currentIndex] = currentCutScene.cameras[currentIndex + 1];
                    currentCutScene.cameras[currentIndex + 1] = currentCamera;
                }
                else
                {
                    currentCutScene.actions[currentIndex] = currentCutScene.actions[currentIndex + 1];
                    currentCutScene.actions[currentIndex + 1] = currentAction;
                }
            }
            if (GUILayout.Button("Delete") && currentIndex != -1)
            {
                deleteCurrent = true;
            }
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();

            DrawDetailPane();

            GUILayout.EndHorizontal();

            GUI.DragWindow();

            if (Event.current.type == EventType.Repaint && GUI.tooltip != toolTip)
            {
                toolTipTime = Time.fixedTime;
                toolTip = GUI.tooltip;
            }
        }
 public RunCutScene(State onState, List<string> parameter, CutSceneDefinition cutSceneDefinition)
     : base(onState, parameter)
 {
     this.cutSceneDefinition = cutSceneDefinition;
 }