/// <summary>
        /// Ons the mecanim event add.
        /// </summary>
        /// <param name="args">Arguments.</param>
        void onMecanimEventAdd(TimeLineArgs <float> args)
        {
            //create and add node to internal bhv tree
            SendEventNormalizedNode child = mecanimNode.tree.AddNode(typeof(SendEventNormalizedNode)) as SendEventNormalizedNode;

            //add node to its parent list
            mecanimNode.Insert(args.selectedIndex, child);
            //child.timeNormalized.Value = args.selectedValue;
            (child.timeNormalized.serializedProperty as SerializedProperty).floatValue = args.selectedValue;

            mecanimNode.tree.SaveNodes();

            eventTimeValues = (float[])args.values;

            //recreate (not to optimal but doesn't have
            eventDisplayNames = mecanimNode.children.Select((val) => ((SendEventNormalizedNode)val).name).ToArray();



            //show popup
            SendEventNormalizedNodeEditorWindow.Show(child, eventTimeLineValuePopUpRect);



            Undo.RecordObject(target.self, "Add Node");

            EditorApplication.SaveScene();
        }
        /// <summary>
        /// Ons the mecanim event drag end.
        /// </summary>
        /// <param name="args">Arguments.</param>
        void onMecanimEventDragEnd(TimeLineArgs <float> args)
        {
            int[] indexArray = new int[mecanimNode.children.Length];
            for (int l = 0; l < indexArray.Length; l++)
            {
                indexArray [l] = l;
            }

            Array.Sort(mecanimNode.children, indexArray, eventTimeComparer);

            bool[] cloneOfSelected = (bool[])eventTimeValuesSelected.Clone();
            int    inx             = -1;
            SendEventNormalizedNode ev;

            for (int m = 0; m < indexArray.Length; m++)
            {
                inx = indexArray [m];
                ev  = ((SendEventNormalizedNode)mecanimNode.children [m]);
                this.eventTimeValuesSelected [m] = cloneOfSelected [inx];
                //this.eventTimeValues [m] = (float)ev.timeNormalized.Value;
                this.eventTimeValues [m]   = (float)(ev.timeNormalized.serializedProperty as SerializedProperty).floatValue;
                this.eventDisplayNames [m] = ev.name;
            }



            mecanimNode.tree.HierarchyChanged();
            StateUtility.SetDirty(mecanimNode.tree);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Ons the keyframe delete.
        /// </summary>
        /// <param name="args">Arguments.</param>
        static void onKeyframeDelete(TimeLineArgs <float> args)
        {
            EditorClipBinding clipBindingCurrent = (clipBindingsSerialized.value as EditorClipBinding[]).FirstOrDefault((itm) => itm.gameObject != null && itm.gameObject.transform.childCount > 0 && itm.gameObject.transform.GetChild(0).gameObject == Selection.activeGameObject);


            //AnimationUtilityEx.RemoveKeyframeFrom (clipBindingCurrent.clip, args.selectedIndex);
        }
Ejemplo n.º 4
0
        public void MentionsTimeLine()
        {
            WithClient(c =>
            {
                var args = new TimeLineArgs();
                var statuses = c.MentionsTimeLine(args);

                Assert.That(statuses, Is.Not.Null);
            });
        }
        ///  TIMELINE EVENTHANDLERS


        /// <summary>
        /// Ons the mecanim event edit.
        /// </summary>
        /// <param name="args">Arguments.</param>
        void onMecanimEventEdit(TimeLineArgs <float> args)
        {
            SendEventNormalizedNode child = mecanimNode.children [args.selectedIndex] as SendEventNormalizedNode;


            //child.timeNormalized.Value = args.selectedValue;
            (child.timeNormalized.serializedProperty as SerializedProperty).floatValue = args.selectedValue;
            //child.timeNormalized.ApplyModifiedProperties ();
            SendEventNormalizedNodeEditorWindow.Show(child, eventTimeLineValuePopUpRect);
        }
        /// <summary>
        /// Ons the mecanim event delete.
        /// </summary>
        /// <param name="args">Arguments.</param>
        void onMecanimEventDelete(TimeLineArgs <float> args)
        {
            float[] timeValues       = (float[])args.values;
            int     timeValuesNumber = timeValues.Length;



            SendEventNormalizedNode child;

            for (int i = 0; i < mecanimNode.children.Length;)
            {
                child = mecanimNode.children [i] as SendEventNormalizedNode;

                if (i < timeValuesNumber)
                {
                    //child.timeNormalized.Value = timeValues [i];
                    (child.timeNormalized.serializedProperty as SerializedProperty).floatValue = timeValues [i];
                    i++;
                }
                else
                {
                    //remove localy from node parent
                    mecanimNode.Remove(child);
                    //remove from internal behaviour tree
                    mecanimNode.tree.RemoveNode(child, false);
                }
            }



            mecanimNode.tree.SaveNodes();

            //assign to display new
            eventTimeValues = timeValues;



            //recreate
            eventDisplayNames = mecanimNode.children.Select((val) => ((SendEventNormalizedNode)val).name).ToArray();



            StateUtility.SetDirty(mecanimNode.tree);

            Undo.RecordObject(target.self, "Delete Node");
            //SendEventNormalizedEditor.Hide ();
        }
Ejemplo n.º 7
0
        public void TimeLineWithArgsPage(
            [ValueSource("TimeLineFuncs")]Func<TwitterRestClient, TimeLineArgs, Statuses> func)
        {
            WithClient(c =>
                {
                    var args = new TimeLineArgs
                        {MaxId = long.Parse(this._currentStatusId)};
                    var statuses = func(c, args);

                    var min = statuses.Select(s => s.Id).Min();

                    args.Page = 2;
                    var secondPage = func(c, args);
                    var max = secondPage.Select(s => s.Id).Max();

                    Assert.That(max, Is.LessThan(min));
                });
        }
 /// <summary>
 /// On the mecanim event close.
 /// </summary>
 /// <param name="args">Arguments.</param>
 void onMecanimEventClose(TimeLineArgs <float> args)
 {
     //SendEventNormalizedEditor.Hide ();
 }
Ejemplo n.º 9
0
 /////////////  HANDLING KEYFRAMES ROTATION/SCALE Events ////////////////
 /// <summary>
 /// Ons the mecanim event edit.
 /// </summary>
 /// <param name="args">Arguments.</param>
 static void onKeyframeEdit(TimeLineArgs<float> args)
 {
     __timeNormalized = args.selectedValue;
             __timeNormalizedUpdate = true;
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Ons the keyframe delete.
        /// </summary>
        /// <param name="args">Arguments.</param>
        static void onKeyframeDelete(TimeLineArgs<float> args)
        {
            EditorClipBinding clipBindingCurrent = (clipBindingsSerialized.value as EditorClipBinding[]).FirstOrDefault ((itm) => itm.gameObject != null && itm.gameObject.transform.childCount > 0 && itm.gameObject.transform.GetChild (0).gameObject == Selection.activeGameObject);

                            AnimationUtilityEx.RemoveKeyframeFrom (clipBindingCurrent.clip, args.selectedIndex);
        }
Ejemplo n.º 11
0
        ///  TIMELINE EVENTHANDLERS
        /// <summary>
        /// Ons the mecanim event edit.
        /// </summary>
        /// <param name="args">Arguments.</param>
        void onMecanimEventEdit(TimeLineArgs<float> args)
        {
            SendEventNormalizedNode child = mecanimNode.children [args.selectedIndex] as SendEventNormalizedNode;

                        //child.timeNormalized.Value = args.selectedValue;
                        child.timeNormalized.serializedProperty.floatValue = args.selectedValue;
                        //child.timeNormalized.ApplyModifiedProperties ();
                        SendEventNormalizedNodeEditorWindow.Show (child, eventTimeLineValuePopUpRect);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Ons the mecanim event drag end.
        /// </summary>
        /// <param name="args">Arguments.</param>
        void onMecanimEventDragEnd(TimeLineArgs<float> args)
        {
            int[] indexArray = new int[mecanimNode.children.Length];
                        for (int l = 0; l < indexArray.Length; l++) {
                                indexArray [l] = l;
                        }

                        Array.Sort (mecanimNode.children, indexArray, eventTimeComparer);

                        bool[] cloneOfSelected = (bool[])eventTimeValuesSelected.Clone ();
                        int inx = -1;
                        SendEventNormalizedNode ev;
                        for (int m = 0; m < indexArray.Length; m++) {

                                inx = indexArray [m];
                                ev = ((SendEventNormalizedNode)mecanimNode.children [m]);
                                this.eventTimeValuesSelected [m] = cloneOfSelected [inx];
                                //this.eventTimeValues [m] = (float)ev.timeNormalized.Value;
                                this.eventTimeValues [m] = (float)ev.timeNormalized.serializedProperty.floatValue;
                                this.eventDisplayNames [m] = ev.name;

                        }

                        mecanimNode.tree.HierarchyChanged ();
                        StateUtility.SetDirty (mecanimNode.tree);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Ons the mecanim event delete.
        /// </summary>
        /// <param name="args">Arguments.</param>
        void onMecanimEventDelete(TimeLineArgs<float> args)
        {
            float[] timeValues = (float[])args.values;
                        int timeValuesNumber = timeValues.Length;

                        SendEventNormalizedNode child;
                        for (int i=0; i<mecanimNode.children.Length;) {
                                child = mecanimNode.children [i] as SendEventNormalizedNode;

                                if (i < timeValuesNumber) {

                                        //child.timeNormalized.Value = timeValues [i];
                                        child.timeNormalized.serializedProperty.floatValue = timeValues [i];
                                        i++;
                                } else {
                                        //remove localy from node parent
                                        mecanimNode.Remove (child);
                                        //remove from internal behaviour tree
                                        mecanimNode.tree.RemoveNode (child, false);

                                }

                        }

                        mecanimNode.tree.SaveNodes ();

                        //assign to display new
                        eventTimeValues = timeValues;

                        //recreate
                        eventDisplayNames = mecanimNode.children.Select ((val) => ((SendEventNormalizedNode)val).name).ToArray ();

                        StateUtility.SetDirty (mecanimNode.tree);

                        Undo.RecordObject (target.self, "Delete Node");
                        //SendEventNormalizedEditor.Hide ();
        }
Ejemplo n.º 14
0
 /// <summary>
 /// On the mecanim event close.
 /// </summary>
 /// <param name="args">Arguments.</param>
 void onMecanimEventClose(TimeLineArgs<float> args)
 {
     //SendEventNormalizedEditor.Hide ();
 }
Ejemplo n.º 15
0
        /// <summary>
        /// Ons the mecanim event add.
        /// </summary>
        /// <param name="args">Arguments.</param>
        void onMecanimEventAdd(TimeLineArgs<float> args)
        {
            //create and add node to internal bhv tree
                        SendEventNormalizedNode child = mecanimNode.tree.AddNode (typeof(SendEventNormalizedNode)) as SendEventNormalizedNode;

                        //add node to its parent list
                        mecanimNode.Insert (args.selectedIndex, child);
                        //child.timeNormalized.Value = args.selectedValue;
                        child.timeNormalized.serializedProperty.floatValue = args.selectedValue;

                        mecanimNode.tree.SaveNodes ();

                        eventTimeValues = (float[])args.values;

                        //recreate (not to optimal but doesn't have
                        eventDisplayNames = mecanimNode.children.Select ((val) => ((SendEventNormalizedNode)val).name).ToArray ();

                        //show popup
                        SendEventNormalizedNodeEditorWindow.Show (child, eventTimeLineValuePopUpRect);

                        Undo.RecordObject (target.self, "Add Node");

                        EditorApplication.SaveScene ();
        }
Ejemplo n.º 16
0
        /////////////  HANDLING KEYFRAMES ROTATION/SCALE Events ////////////////

        /// <summary>
        /// Ons the mecanim event edit.
        /// </summary>
        /// <param name="args">Arguments.</param>
        static void onKeyframeEdit(TimeLineArgs <float> args)
        {
            __timeNormalized       = args.selectedValue;
            __timeNormalizedUpdate = true;
        }