Exemple #1
0
        private void ShowDropdown(Rect pointsManager, List <Map.Point> points, Map.Point point)
        {
            PointChoicePopup menu = new PointChoicePopup();

            menu.Initialization(this, points, point);
            PopupWindow.Show(pointsManager, menu);
        }
Exemple #2
0
        private void AddPoint(Map.Point point, TimelinePoint prefab, Dictionary <Map.Point, TimelinePoint> dict, float songLength)
        {
            float timePercentage     = point.time / songLength;
            float positionOnTimeline = timePercentage * space.localScale.x * 10 / zoom;

            if (prefab != null && space != null)
            {
                if (dict == null)
                {
                    dict = new Dictionary <Map.Point, TimelinePoint>();
                }
                if (dict.ContainsKey(point) && dict[point] == null)
                {
                    dict.Remove(point);
                }
                if (!dict.ContainsKey(point))
                {
                    TimelinePoint timelinePoint = Instantiate(prefab, transform);
                    timelinePoint.SetPoint(positionOnTimeline);
                    dict.Add(point, timelinePoint);
                }
            }
            else
            {
                if (prefab == null)
                {
                    Debug.LogError(Logger.NotAssigned(typeof(TimelinePoint), GetType(), name));
                }
                if (space == null)
                {
                    Debug.LogError(Logger.NotAssigned(typeof(RectTransform), GetType(), name));
                }
            }
        }
Exemple #3
0
 private void ChangeCurrentPoint(int indexInList)
 {
     if (map.points != null && map.points.Count != 0)
     {
         indexInList  = Mathf.Clamp(indexInList, 0, map.points.Count - 1);
         currentPoint = map.points[indexInList];
     }
     if (currentPoint != null)
     {
         UpdateTime(currentPoint.time);
     }
 }
Exemple #4
0
 private void DeletePoint(Map.Point point)
 {
     if (map.points != null)
     {
         int previousIndex = map.points.IndexOf(point) - 1;
         if (previousIndex < 0)
         {
             previousIndex = 0;
         }
         map.points.Remove(point);
         ChangeCurrentPoint(previousIndex);
     }
 }
Exemple #5
0
 private void AddPoint(int tileIndex)
 {
     if (map.points == null)
     {
         map.points = new List <Map.Point>();
     }
     foreach (Map.Point point in map.points)
     {
         if (point.time == currentTime)
         {
             point.tileIndex = tileIndex;
             return;
         }
     }
     Map.Point newPoint = new Map.Point(currentTime, tileIndex);
     map.points.Add(newPoint);
     map.points.Sort();
 }
Exemple #6
0
 private void SetCurrentPointFromCurrentTime()
 {
     if (map.points != null && map.points.Count > 0)
     {
         currentPoint = map.points[0];
         foreach (Map.Point point in map.points)
         {
             if (point.time <= currentTime)
             {
                 currentPoint = point;
             }
         }
     }
     else
     {
         currentPoint = null;
     }
 }
Exemple #7
0
 public void Initialization(MainWindow newParent, List <Map.Point> newPoints, Map.Point newCurrentPoint)
 {
     parent       = newParent;
     points       = newPoints;
     currentPoint = newCurrentPoint;
 }
 /// <summary>
 /// Create a new ballistic movement
 /// </summary>
 /// <param name="startPoint">Start point for the ballistic movement</param>
 /// <param name="destinationPoint">Destionation point for the ballistic movement</param>
 public BallisticMoveManager(Map.Point startPoint, Map.Point destinationPoint)
 {
     this.tick = 0;
     this.startPoint = startPoint;
     this.destinationPoint = destinationPoint;
 }