Beispiel #1
0
        public static void ShowProgressEditor(Rect rect, ProgressDataControl progress)
        {
            var window = ProgressEditorWindow.Create(progress);

            rect.position = GUIUtility.GUIToScreenPoint(rect.position);
            window.ShowAsDropDown(rect, new Vector2(Mathf.Max(rect.width, 250), 300));
        }
 public CompletableDataControl(Completable completable)
 {
     this.completable         = completable;
     this.startDataControl    = new MilestoneDataControl(completable.getStart());
     this.endDataControl      = new MilestoneDataControl(completable.getEnd());
     this.progressDataControl = new ProgressDataControl(completable.getProgress());
     this.scoreDataControl    = new ScoreDataControl(completable.getScore());
 }
Beispiel #3
0
        public void Init(ProgressDataControl progressDataControl)
        {
            this.progress = progressDataControl;

            progressList = new DataControlList()
            {
                RequestRepaint = Repaint,
                Columns        = new List <ColumnList.Column>()
                {
                    new ColumnList.Column()
                    {
                        Text = "Analytics.Milestone.Time".Traslate()
                    }
                },
                drawCell = (rect, row, column, isActive, isFocused) =>
                {
                    var milestone = progressList.list[row] as MilestoneDataControl;
                    if (milestone == null)
                    {
                        return;
                    }

                    switch (column)
                    {
                    default:
                        if (GUI.Button(rect, milestone.getContent().ToString()))
                        {
                            MilestoneEditorWindow.ShowMilestoneEditor(rect, milestone);
                        }
                        break;

                    case 1:
                        EditorGUI.BeginChangeCheck();
                        var newProgress = EditorGUI.Slider(rect, "", milestone.getProgress(), 0, 1);
                        if (EditorGUI.EndChangeCheck())
                        {
                            milestone.setProgress(newProgress);
                        }
                        break;
                    }
                }
            };

            progressColumn = new ColumnList.Column()
            {
                Text = "Analytics.Completable.Progress".Traslate()
            };
        }
Beispiel #4
0
 public static ProgressEditorWindow Create(ProgressDataControl progress)
 {
     editor = ScriptableObject.CreateInstance <ProgressEditorWindow>();
     editor.Init(progress);
     return(editor);
 }