コード例 #1
0
        public void solve()
        {
            EquationSystem system = new EquationSystem(_limits);
            var            result = system.solve();

            StartMethod?.Invoke(new StartMethodObject(new PointS(result, solveFunction(result.X, result.Y)), _limits, _func));

            if (Utils.IsInteger(result))
            {
                _maxS = new PointS(result, solveFunction(result.X, result.Y));
            }
            else
            {
                List <int> list = new List <int>();
                if (!Utils.IsInteger(result.X))
                {
                    solve(_limits, new Equation(1, 0, ">=", Math.Ceiling(result.X)), new List <int>(list));
                    solve(_limits, new Equation(1, 0, "<=", Math.Floor(result.X)), new List <int>(list));
                }
                else
                {
                    solve(_limits, new Equation(0, 1, ">=", Math.Ceiling(result.Y)), new List <int>(list));
                    solve(_limits, new Equation(0, 1, "<=", Math.Floor(result.Y)), new List <int>(list));
                }
            }
            EndMethod.Invoke(this, new EndMethodObject(_maxS, true));
        }
コード例 #2
0
        public void Update(Object[] args)
        {
            if (StartMethod != null)
            {
                foreach (var instance in StartList)
                {
                    var node = instance.Node;

                    if (node != null && node.IsEnabled())
                    {
                        if (node.Scene != null)
                        {
                            StartMethod.Invoke(instance, null);
                        }
                    }
                }

                // TODO: need to handle delayed starts when node isn't enabled
                StartList.Clear();
            }

            if (UpdateMethod != null)
            {
                foreach (var instance in Instances)
                {
                    bool remove = false;

                    var node = instance.Node;

                    if (node != null && node.IsEnabled())
                    {
                        if (node.Scene != null)
                        {
                            UpdateMethod.Invoke(instance, args);
                        }
                        else
                        {
                            remove = true;
                        }
                    }
                    else
                    {
                        remove = true;
                    }

                    if (remove)
                    {
                        RemoveList.Add(instance);
                    }
                }
            }

            foreach (var instance in RemoveList)
            {
                Instances.Remove(instance);
            }

            RemoveList.Clear();
        }
コード例 #3
0
    /// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        trigger.Update();

        EditorGUILayout.PropertyField(cutName, cutsceneIdContent);
//        EditorGUILayout.PropertyField(cutscene);
//
//        if (string.IsNullOrEmpty(cutName.stringValue) && cutscene.objectReferenceValue != null)
//        {
//            cutName.stringValue = cutscene.objectReferenceValue.name;
//        }
        StartMethod newStartMethod = (StartMethod)EditorGUILayout.EnumPopup(startMethodContent, (StartMethod)startMethod.enumValueIndex);

        if (newStartMethod != (StartMethod)startMethod.enumValueIndex)
        {
            startMethod.enumValueIndex = (int)newStartMethod;

            if (newStartMethod == StartMethod.OnTrigger)
            {
                CutsceneTrigger cutsceneTrigger = (this.target as CutsceneTrigger);
                Collider        collider        = cutsceneTrigger.gameObject.GetComponent <BoxCollider>();
                if (collider == null)
                {
                    cutsceneTrigger.gameObject.AddComponent <BoxCollider>();
                }
            }
            else
            {
                // Can't cleanly destroy collider yet.
                CutsceneTrigger cutsceneTrigger = (this.target as CutsceneTrigger);
                Collider        collider        = cutsceneTrigger.gameObject.GetComponent <BoxCollider>();
                if (collider != null)
                {
                    collider.enabled = false;
                }
            }
        }

        if (newStartMethod == StartMethod.OnTrigger)
        {
            CutsceneTrigger cutsceneTrigger = (this.target as CutsceneTrigger);
            Collider        collider        = cutsceneTrigger.gameObject.GetComponent <BoxCollider>();
            collider.enabled = true;
        }

        EditorGUILayout.PropertyField(loop);
//        EditorGUILayout.PropertyField(skipButton);

        trigger.ApplyModifiedProperties();
    }
    /// <summary>
    /// Draw the inspector
    /// </summary>
    public override void OnInspectorGUI()
    {
        trigger.Update();

        EditorGUILayout.PropertyField(cutscene);
        StartMethod newStartMethod = (StartMethod)EditorGUILayout.EnumPopup(startMethodContent, (StartMethod)startMethod.enumValueIndex);

        if (newStartMethod != (StartMethod)startMethod.enumValueIndex)
        {
            startMethod.enumValueIndex = (int)newStartMethod;

            CutsceneTrigger cutsceneTrigger = (this.target as CutsceneTrigger);
            if (newStartMethod == StartMethod.OnTrigger || newStartMethod == StartMethod.OnTriggerStayAndButtonDown)
            {
                if (cutsceneTrigger != null && cutsceneTrigger.gameObject.GetComponent <BoxCollider>() == null)
                {
                    cutsceneTrigger.gameObject.AddComponent <BoxCollider>();
                    cutsceneTrigger.gameObject.GetComponent <BoxCollider>().isTrigger = true;
                }
                else if (cutsceneTrigger != null && cutsceneTrigger.gameObject.GetComponent <BoxCollider>() != null)
                {
                    cutsceneTrigger.gameObject.GetComponent <BoxCollider>().isTrigger = true;
                }
            }
            else
            {
                // Can't cleanly destroy collider yet.
                //CutsceneTrigger cutsceneTrigger = (this.target as CutsceneTrigger);
                //if (cutsceneTrigger != null && cutsceneTrigger.gameObject.GetComponent<Collider>() != null)
                //{
                //    Collider c = cutsceneTrigger.gameObject.GetComponent<Collider>();
                //    DestroyImmediate(c, true);
                //}
            }
        }

        if (newStartMethod == StartMethod.OnTrigger)
        {
            EditorGUILayout.PropertyField(triggerObject);
        }
        else if (newStartMethod == StartMethod.OnTriggerStayAndButtonDown)
        {
            EditorGUILayout.PropertyField(triggerObject);
            EditorGUILayout.PropertyField(triggerButton);
        }

        EditorGUILayout.PropertyField(skipButton);

        trigger.ApplyModifiedProperties();
    }
コード例 #5
0
    /// <summary>
    /// Draws the Director GUI
    /// </summary>
    protected void OnGUI()
    {
        scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
        {
            txtCutsceneName = EditorGUILayout.TextField(NameContentCutscene, txtCutsceneName);

            EditorGUILayout.BeginHorizontal();
            txtDuration = EditorGUILayout.FloatField(DurationContentCutscene, txtDuration);
            timeEnum = (DirectorHelper.TimeEnum)EditorGUILayout.EnumPopup(timeEnum);
            EditorGUILayout.EndHorizontal();

            isLooping = EditorGUILayout.Toggle(LoopingContentCutscene, isLooping);
            isSkippable = EditorGUILayout.Toggle(SkippableContentCutscene, isSkippable);
            StartMethod = (StartMethod)EditorGUILayout.EnumPopup(new GUIContent("Start Method"), StartMethod);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Track Groups", EditorStyles.boldLabel);

            // Director Group
            directorTrackGroupsSelection = EditorGUILayout.Popup(AddDirectorGroupContent, directorTrackGroupsSelection, intValues1.ToArray());
            
            if(directorTrackGroupsSelection > 0)
            {
                EditorGUI.indentLevel++;

                // Shot Tracks
                shotTrackSelection = EditorGUILayout.Popup(AddShotTracksContent, shotTrackSelection, intValues1.ToArray());

                // Audio Tracks
                audioTrackSelection = EditorGUILayout.Popup(AddAudioTracksContent, audioTrackSelection, intValues4.ToArray());

                // Global Item Tracks
                globalItemTrackSelection = EditorGUILayout.Popup(AddGlobalTracksContent, globalItemTrackSelection, intValues10.ToArray());

                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();

            // Actor Track Groups
            int actorCount = EditorGUILayout.Popup(new GUIContent("Actor Track Groups"), actorTrackGroupsSelection, intValues10.ToArray());

            if (actorCount != actorTrackGroupsSelection)
            {
                actorTrackGroupsSelection = actorCount;

                Transform[] tempActors = new Transform[actors.Length];
                Array.Copy(actors, tempActors, actors.Length);
                
                actors = new Transform[actorCount];
                int amount = Math.Min(actorCount, tempActors.Length);
                Array.Copy(tempActors, actors, amount);
            }

            EditorGUI.indentLevel++;
            for(int i = 1; i <= actorTrackGroupsSelection; i++)
            {
                actors[i - 1] = EditorGUILayout.ObjectField(new GUIContent(string.Format("Actor {0}", i)), actors[i - 1], typeof(Transform), true) as Transform;
            }
            EditorGUI.indentLevel--;

            EditorGUILayout.Space();

            // Multi Actor Track Groups
            multiActorTrackGroupsSelection = EditorGUILayout.Popup(new GUIContent("Multi-Actor Track Groups"), multiActorTrackGroupsSelection, intValues10.ToArray());
            {
                EditorGUI.indentLevel++;

                // Event Tracks

                // Curve Tracks

                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();

            // Character Track Groups
            int characterTGCount = EditorGUILayout.Popup(new GUIContent("Character Track Groups"), characterTrackGroupsSelection, intValues10.ToArray());

            if (characterTGCount != characterTrackGroupsSelection)
            {
                characterTrackGroupsSelection = characterTGCount;

                Transform[] tempCharacters = new Transform[characters.Length];
                Array.Copy(characters, tempCharacters, characters.Length);

                characters = new Transform[characterTGCount];
                int amount = Math.Min(characterTGCount, tempCharacters.Length);
                Array.Copy(tempCharacters, characters, amount);
            }

            EditorGUI.indentLevel++;
            for (int i = 1; i <= characterTrackGroupsSelection; i++)
            {
                characters[i - 1] = EditorGUILayout.ObjectField(new GUIContent(string.Format("Character {0}", i)), characters[i - 1], typeof(Transform), true) as Transform;
            }
            EditorGUI.indentLevel--;

            
        }
        
        EditorGUILayout.EndScrollView();

        EditorGUILayout.BeginHorizontal();
        {
            if (GUILayout.Button("I'm Feeling Lucky"))
            {
                List<Transform> interestingActors = UnitySceneEvaluator.GetHighestRankedGameObjects(10);

                actorTrackGroupsSelection = interestingActors.Count;
                actors = interestingActors.ToArray();
            }

            if (GUILayout.Button("Create Cutscene"))
            {
                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;

                int undoIndex = Undo.GetCurrentGroup();

                if(StartMethod != StartMethod.None)
                {
                    GameObject cutsceneTriggerGO = new GameObject("Cutscene Trigger");
                    CutsceneTrigger cutsceneTrigger = cutsceneTriggerGO.AddComponent<CutsceneTrigger>();
                    if (StartMethod == StartMethod.OnTrigger)
                    {
                        cutsceneTriggerGO.AddComponent<BoxCollider>();
                    }
                    cutsceneTrigger.StartMethod = StartMethod;
                    cutsceneTrigger.Cutscene = cutscene;
                    Undo.RegisterCreatedObjectUndo(cutsceneTriggerGO, string.Format("Created {0}", txtCutsceneName));
                }
                
                Undo.RegisterCreatedObjectUndo(cutsceneGO, string.Format("Created {0}",txtCutsceneName));
                Undo.CollapseUndoOperations(undoIndex);

                Selection.activeTransform = cutsceneGO.transform;

            }
        }
        EditorGUILayout.EndHorizontal();
    }
コード例 #6
0
    /// <summary>
    /// Draws the Director GUI
    /// </summary>
    protected void OnGUI()
    {
        scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
        {
            txtCutsceneName = EditorGUILayout.TextField(NameContentCutscene, txtCutsceneName);
            EditorGUILayout.BeginHorizontal();
            txtDuration = EditorGUILayout.FloatField(DurationContentCutscene, txtDuration);
            timeEnum    = (DirectorHelper.TimeEnum)EditorGUILayout.EnumPopup(timeEnum);
            EditorGUILayout.EndHorizontal();

            isLooping   = EditorGUILayout.Toggle(LoopingContentCutscene, isLooping);
            isSkippable = EditorGUILayout.Toggle(SkippableContentCutscene, isSkippable);
            StartMethod = (StartMethod)EditorGUILayout.EnumPopup(new GUIContent("开始方法"), StartMethod);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("轨道组", EditorStyles.boldLabel);

            // Director Group
            directorTrackGroupsSelection = EditorGUILayout.Popup(AddDirectorGroupContent, directorTrackGroupsSelection, intValues1.ToArray());

            if (directorTrackGroupsSelection > 0)
            {
                EditorGUI.indentLevel++;

                // Shot Tracks
                shotTrackSelection = EditorGUILayout.Popup(AddShotTracksContent, shotTrackSelection, intValues1.ToArray());

                // Audio Tracks
                audioTrackSelection = EditorGUILayout.Popup(AddAudioTracksContent, audioTrackSelection, intValues4.ToArray());

                // Global Item Tracks
                globalItemTrackSelection = EditorGUILayout.Popup(AddGlobalTracksContent, globalItemTrackSelection, intValues10.ToArray());

                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();

            // Actor Track Groups
            int actorCount = EditorGUILayout.Popup(new GUIContent("主角轨道群组"), actorTrackGroupsSelection, intValues10.ToArray());

            if (actorCount != actorTrackGroupsSelection)
            {
                actorTrackGroupsSelection = actorCount;

                Transform[] tempActors = new Transform[actors.Length];
                Array.Copy(actors, tempActors, actors.Length);

                actors = new Transform[actorCount];
                int amount = Math.Min(actorCount, tempActors.Length);
                Array.Copy(tempActors, actors, amount);
            }

            EditorGUI.indentLevel++;
            for (int i = 1; i <= actorTrackGroupsSelection; i++)
            {
                actors[i - 1] = EditorGUILayout.ObjectField(new GUIContent(string.Format("主角 {0}", i)), actors[i - 1], typeof(Transform), true) as Transform;
            }
            EditorGUI.indentLevel--;

            EditorGUILayout.Space();
            // Multi Actor Track Groups
            multiActorTrackGroupsSelection = EditorGUILayout.Popup(new GUIContent("多主角轨道群组"), multiActorTrackGroupsSelection, intValues10.ToArray());
            EditorGUI.indentLevel++;
            EditorGUI.indentLevel--;
            Add(ref characters, ref characterTrackGroupsSelection, "ActorTrackGroups");
            for (int i = 1; i <= characterTrackGroupsSelection; i++)
            {
                characters[i - 1] = EditorGUILayout.ObjectField(new GUIContent(string.Format("角色 {0}", i)), characters[i - 1], typeof(Transform), true) as Transform;
            }
            EditorGUI.indentLevel--;
        }

        EditorGUILayout.EndScrollView();

        EditorGUILayout.BeginHorizontal();
        {
            if (GUILayout.Button("I'm Feeling Lucky"))
            {
                List <Transform> interestingActors = UnitySceneEvaluator.GetHighestRankedGameObjects(10);

                actorTrackGroupsSelection = interestingActors.Count;
                actors = interestingActors.ToArray();
            }

            if (GUILayout.Button("创建剧情"))
            {
                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;

                int undoIndex = Undo.GetCurrentGroup();

                if (StartMethod != StartMethod.None)
                {
                    GameObject      cutsceneTriggerGO = new GameObject("Cutscene Trigger");
                    CutsceneTrigger cutsceneTrigger   = cutsceneTriggerGO.AddComponent <CutsceneTrigger>();
                    if (StartMethod == StartMethod.OnTrigger)
                    {
                        cutsceneTriggerGO.AddComponent <BoxCollider>();
                    }
                    cutsceneTrigger.StartMethod = StartMethod;
                    cutsceneTrigger.Cutscene    = cutscene;
                    Undo.RegisterCreatedObjectUndo(cutsceneTriggerGO, string.Format("Created {0}", txtCutsceneName));
                }

                Undo.RegisterCreatedObjectUndo(cutsceneGO, string.Format("Created {0}", txtCutsceneName));
                Undo.CollapseUndoOperations(undoIndex);
                Selection.activeTransform = cutsceneGO.transform;
            }
        }
        EditorGUILayout.EndHorizontal();
    }
コード例 #7
0
        protected override bool InternalSetParameters(List <CodeParameterBase> parameterBases)
        {
            var inputValue = ((StringParam)parameterBases[0]).Value;

            switch (inputValue)
            {
            case "New Bar":
                _startMethod = StartMethod.NewBar;
                break;

            case "New Tick":
                _startMethod = StartMethod.NewQuote;
                break;

            case "Periodical":
                _startMethod = StartMethod.Periodic;
                break;

            default:
                Exit("Invalid Start Event Parameter.");
                return(false);
            }

            _tradingPeriod = ((IntParam)parameterBases[1]).Value;
            _tradeSlot     = ((IntParam)parameterBases[2]).Value;

            inputValue = ((StringParam)parameterBases[3]).Value;
            switch (inputValue)
            {
            case "Market":
                _execTradesParam.OrderType = TradeType.Market;
                break;

            case "Limit":
                _execTradesParam.OrderType = TradeType.Limit;
                break;

            case "Stop Market":
                _execTradesParam.OrderType = TradeType.Stop;
                break;

            default:
                Exit("Invalid Order Type Parameter.");
                return(false);
            }

            inputValue = ((StringParam)parameterBases[4]).Value;
            switch (inputValue)
            {
            case "FOK":
                _execTradesParam.TIF = TimeInForce.FillOrKill;
                break;

            case "GFD":
                _execTradesParam.TIF = TimeInForce.GoodForDay;
                break;

            case "IOC":
                _execTradesParam.TIF = TimeInForce.ImmediateOrCancel;
                break;

            case "GTC":
                _execTradesParam.TIF = TimeInForce.GoodTilCancelled;
                break;

            default:
                Exit("Invalid TIF Parameter.");
                return(false);
            }

            inputValue = ((StringParam)parameterBases[5]).Value;
            switch (inputValue)
            {
            case "ON":
                _execTradesParam.HideOrder = true;
                break;

            case "OFF":
                _execTradesParam.HideOrder = false;
                break;

            default:
                Exit("Invalid Hide Limit Order Parameter.");
                return(false);
            }

            inputValue = ((StringParam)parameterBases[6]).Value;
            switch (inputValue)
            {
            case "ON":
                _internalBacktest = true;
                break;

            case "OFF":
                _internalBacktest = false;
                break;

            default:
                Exit("Invalid BackTest Mode Parameter.");
                return(false);
            }

            inputValue = ((StringParam)parameterBases[7]).Value;
            switch (inputValue)
            {
            case "OPEN":
                backtestPriceConst = PriceConstants.OPEN;
                break;

            case "HIGH":
                backtestPriceConst = PriceConstants.HIGH;
                break;

            case "LOW":
                backtestPriceConst = PriceConstants.LOW;
                break;

            case "CLOSE":
                backtestPriceConst = PriceConstants.CLOSE;
                break;

            case "OHLC":
                backtestPriceConst = PriceConstants.OHLC;
                break;

            case "OLHC":
                backtestPriceConst = PriceConstants.OLHC;
                break;

            default:
                Exit("Invalid BackTest Price Parameter.");
                return(false);
            }

            inputValue = ((StringParam)parameterBases[8]).Value;
            switch (inputValue)
            {
            case "ON":
                _execTradesParam.HideSL = true;
                break;

            case "OFF":
                _execTradesParam.HideSL = false;
                break;

            default:
                Exit("Invalid Hide Limit Order Parameter.");
                return(false);
            }

            inputValue = ((StringParam)parameterBases[9]).Value;
            switch (inputValue)
            {
            case "ON":
                _execTradesParam.HideTP = true;
                break;

            case "OFF":
                _execTradesParam.HideTP = false;
                break;

            default:
                Exit("Invalid Hide Limit Order Parameter.");
                return(false);
            }

            _execTradesParam.OrderQuantity   = ((IntParam)parameterBases[10]).Value;
            _execTradesParam.SellPriceOffset = ((IntParam)parameterBases[11]).Value;
            _execTradesParam.BuyPriceOffset  = ((IntParam)parameterBases[12]).Value;
            _execTradesParam.SL = (decimal?)((IntParam)parameterBases[13]).Value > 0
                ? (decimal?)((IntParam)parameterBases[13]).Value / 100000
                : null;
            _execTradesParam.TP = (decimal?)((IntParam)parameterBases[14]).Value > 0
                ? (decimal?)((IntParam)parameterBases[14]).Value / 100000
                : null;
            _backtestBatch = ((IntParam)parameterBases[15]).Value;


            return(true);
        }
コード例 #8
0
    /// <summary>
    /// Draws the Director GUI
    /// </summary>
    protected void OnGUI()
    {
        scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
        {
            txtCutsceneName = EditorGUILayout.TextField(NameContentCutscene, txtCutsceneName);

            EditorGUILayout.BeginHorizontal();
            txtDuration = EditorGUILayout.FloatField(DurationContentCutscene, txtDuration);
            timeEnum    = (DirectorHelper.TimeEnum)EditorGUILayout.EnumPopup(timeEnum);
            EditorGUILayout.EndHorizontal();

            isLooping   = EditorGUILayout.Toggle(LoopingContentCutscene, isLooping);
            isSkippable = EditorGUILayout.Toggle(SkippableContentCutscene, isSkippable);
            StartMethod = (StartMethod)EditorGUILayout.EnumPopup(new GUIContent("Start Method"), StartMethod);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Track Groups", EditorStyles.boldLabel);

            // Director Group
            directorTrackGroupsSelection = EditorGUILayout.Popup(AddDirectorGroupContent, directorTrackGroupsSelection, intValues1.ToArray());

            if (directorTrackGroupsSelection > 0)
            {
                EditorGUI.indentLevel++;

                // Shot Tracks
                shotTrackSelection = EditorGUILayout.Popup(AddShotTracksContent, shotTrackSelection, intValues1.ToArray());

                // Audio Tracks
                audioTrackSelection = EditorGUILayout.Popup(AddAudioTracksContent, audioTrackSelection, intValues4.ToArray());

                // Global Item Tracks
                globalItemTrackSelection = EditorGUILayout.Popup(AddGlobalTracksContent, globalItemTrackSelection, intValues10.ToArray());

                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();

            // Actor Track Groups
            int actorCount = EditorGUILayout.Popup(new GUIContent("Actor Track Groups"), actorTrackGroupsSelection, intValues10.ToArray());

            if (actorCount != actorTrackGroupsSelection)
            {
                actorTrackGroupsSelection = actorCount;

                Transform[] tempActors = new Transform[actors.Length];
                Array.Copy(actors, tempActors, actors.Length);

                actors = new Transform[actorCount];
                int amount = Math.Min(actorCount, tempActors.Length);
                Array.Copy(tempActors, actors, amount);
            }

            EditorGUI.indentLevel++;
            for (int i = 1; i <= actorTrackGroupsSelection; i++)
            {
                actors[i - 1] = EditorGUILayout.ObjectField(new GUIContent(string.Format("Actor {0}", i)), actors[i - 1], typeof(Transform), true) as Transform;
            }
            EditorGUI.indentLevel--;

            EditorGUILayout.Space();

            // Multi Actor Track Groups
            multiActorTrackGroupsSelection = EditorGUILayout.Popup(new GUIContent("Multi-Actor Track Groups"), multiActorTrackGroupsSelection, intValues10.ToArray());
            {
                EditorGUI.indentLevel++;

                // Event Tracks

                // Curve Tracks

                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Space();

            // Character Track Groups
            int characterTGCount = EditorGUILayout.Popup(new GUIContent("Character Track Groups"), characterTrackGroupsSelection, intValues10.ToArray());

            if (characterTGCount != characterTrackGroupsSelection)
            {
                characterTrackGroupsSelection = characterTGCount;

                Transform[] tempCharacters = new Transform[characters.Length];
                Array.Copy(characters, tempCharacters, characters.Length);

                characters = new Transform[characterTGCount];
                int amount = Math.Min(characterTGCount, tempCharacters.Length);
                Array.Copy(tempCharacters, characters, amount);
            }

            EditorGUI.indentLevel++;
            for (int i = 1; i <= characterTrackGroupsSelection; i++)
            {
                characters[i - 1] = EditorGUILayout.ObjectField(new GUIContent(string.Format("Character {0}", i)), characters[i - 1], typeof(Transform), true) as Transform;
            }
            EditorGUI.indentLevel--;
        }

        EditorGUILayout.EndScrollView();

        EditorGUILayout.BeginHorizontal();
        {
            if (GUILayout.Button("I'm Feeling Lucky"))
            {
                List <Transform> interestingActors = UnitySceneEvaluator.GetHighestRankedGameObjects(10);

                actorTrackGroupsSelection = interestingActors.Count;
                actors = interestingActors.ToArray();
            }

            if (GUILayout.Button("Create Cutscene"))
            {
                CreateCutscene();
            }
        }
        EditorGUILayout.EndHorizontal();
    }
コード例 #9
0
 public TaskStartInfo(StartMethod startMethod, ThreadWorkerTaskBase task, DuplicateTaskQueued action)
 {
     this.startMethod = startMethod;
     this.task        = task;
     this.action      = action;
 }
コード例 #10
0
 public OpenSettings(string path, StartMethod method, bool remember)
 {
     MapsetPath = path;
     Method     = method;
     Remember   = remember;
 }