public static void StopPlayback()
 {
     foreach (AnimationManager animationManager in SelectionExtensions.GetSelected <AnimationManager>())
     {
         animationManager.CurrentAnim.StopPlayback();
     }
 }
 public static void DeleteRecording()
 {
     foreach (AnimationManager animationManager in SelectionExtensions.GetSelected <AnimationManager>())
     {
         animationManager.CurrentAnim.Delete();
         animationManager.recordStartFrame = 0;
     }
 }
 public static void StopRecording()
 {
     foreach (AnimationManager animationManager in SelectionExtensions.GetSelected <AnimationManager>())
     {
         if (animationManager.record)
         {
             animationManager.record           = false;
             animationManager.recordStartFrame = animationManager.startFrameForPreviousRecord;
         }
     }
 }
 public static void StartRecording()
 {
     foreach (AnimationManager animationManager in SelectionExtensions.GetSelected <AnimationManager>())
     {
         if (!animationManager.record)
         {
             if (animationManager.CurrentRecordSettings.timeSpan.startFrame != MathfExtensions.NULL_INT)
             {
                 animationManager.recordStartFrame = animationManager.CurrentRecordSettings.timeSpan.startFrame;
             }
             else
             {
                 animationManager.recordStartFrame = animationManager.startFrameForPreviousRecord;
             }
             animationManager.startFrameForPreviousRecord = animationManager.recordStartFrame;
             animationManager.record = true;
         }
     }
 }
Beispiel #5
0
        public static void MakeWaypointsBetweenObjects()
        {
            Saw saw = SelectionExtensions.GetInstance <Saw>();

            Transform[] selectedTransforms = SelectionExtensions.GetSelected <Transform>();
            foreach (Transform selectedTrs in selectedTransforms)
            {
                foreach (Transform selectedTrs2 in selectedTransforms)
                {
                    if (selectedTrs != selectedTrs2)
                    {
                        LineSegment2D lineSegment = new LineSegment2D(selectedTrs.position, selectedTrs2.position);
                        float         distance    = 0;
                        do
                        {
                            Vector2 spawnPosition = lineSegment.GetPointWithDirectedDistance(distance);
                            Instantiate(saw.objectWithWaypoints.wayPointsParent.GetChild(0), spawnPosition, Quaternion.identity, saw.trs);
                            distance += saw.testDistanceBetweenWaypoints;
                        } while (distance <= lineSegment.GetLength());
                    }
                }
            }
        }
 public static void SetChosenInstances()
 {
     chosenInstances = SelectionExtensions.GetSelected <AnimationManager>();
 }