internal void addGlobalItemTrack()
    {
        DirectorGroup directorGroup = base.serializedObject.targetObject as DirectorGroup;

        Undo.RegisterCreatedObjectUndo(CutsceneItemFactory.CreateGlobalItemTrack(directorGroup), "Create Global Track");
    }
Exemplo n.º 2
0
    public Cutscene CreateCutscene()
    {
        string cutsceneName = DirectorHelper.getCutsceneItemName(txtCutsceneName, typeof(Cutscene));

        GameObject cutsceneGO = new GameObject(cutsceneName);
        Cutscene   cutscene   = cutsceneGO.AddComponent <Cutscene>();

        for (int i = 0; i < directorTrackGroupsSelection; i++)
        {
            DirectorGroup dg = CutsceneItemFactory.CreateDirectorGroup(cutscene);
            dg.Ordinal = 0;
            for (int j = 0; j < shotTrackSelection; j++)
            {
                CutsceneItemFactory.CreateShotTrack(dg);
            }
            for (int j = 0; j < audioTrackSelection; j++)
            {
                CutsceneItemFactory.CreateAudioTrack(dg);
            }
            for (int j = 0; j < globalItemTrackSelection; j++)
            {
                CutsceneItemFactory.CreateGlobalItemTrack(dg);
            }
        }

        for (int i = 0; i < actorTrackGroupsSelection; i++)
        {
            CutsceneItemFactory.CreateActorTrackGroup(cutscene, actors[i]);
        }

        for (int i = 0; i < multiActorTrackGroupsSelection; i++)
        {
            CutsceneItemFactory.CreateMultiActorTrackGroup(cutscene);
        }

        for (int i = 0; i < characterTrackGroupsSelection; i++)
        {
            CutsceneItemFactory.CreateCharacterTrackGroup(cutscene, characters[i]);
        }

        float duration = txtDuration;

        if (timeEnum == DirectorHelper.TimeEnum.Minutes)
        {
            duration *= 60;
        }
        cutscene.Duration = duration;

        cutscene.IsLooping = isLooping;

        cutscene.IsSkippable = isSkippable;

        int undoIndex = Undo.GetCurrentGroup();

        if (StartMethod != StartMethod.None)
        {
            CreateCutsceneTrigger(cutscene);
        }

        Undo.RegisterCreatedObjectUndo(cutsceneGO, string.Format("Created {0}", txtCutsceneName));
        Undo.CollapseUndoOperations(undoIndex);

        Selection.activeTransform = cutsceneGO.transform;

        return(cutscene);
    }
    private void addGlobalTrack()
    {
        DirectorGroup dg = TrackGroup.Behaviour as DirectorGroup;

        Undo.RegisterCreatedObjectUndo(CutsceneItemFactory.CreateGlobalItemTrack(dg), "Create Global Track");
    }