Beispiel #1
0
        private void UpdateDrawInfo()
        {
            if (BuildMechine.Instance != null)
            {
                _buildInfos.Clear();

                _runtimeContext = BuildMechine.Instance.Context;

                for (var index = 0; index < BuildMechine.Instance.Actions.Count; index++)
                {
                    var instanceAction = BuildMechine.Instance.Actions[index];

                    var state = "<color=grey>wait</color>";

                    if (index == BuildMechine.Instance.CurrentActionIndex)
                    {
                        if (BuildMechine.Instance.AnyError == false)
                        {
                            state = "<color=yellow>running</color>";
                        }
                        else
                        {
                            state = "<color=red>fail</color>";
                        }
                    }
                    else if (index < BuildMechine.Instance.CurrentActionIndex)
                    {
                        state = "<color=green>done</color>";
                    }

                    _buildInfos.Add(new BuildInfo()
                    {
                        Index      = index,
                        ActionName = instanceAction.GetType().Name,
                        State      = state,
                        Duration   = BuildMechine.Instance.ActionTimers[index].Duration
                    });
                }

                _totalDuration = BuildMechine.Instance.MechineTimer.Duration;

                BuildMechine.ShowProgress();
            }
        }
Beispiel #2
0
 public static BuildMechine NewPipeline()
 {
     Instance         = new BuildMechine();
     Instance.Actions = new List <BuildAction>();
     return(Instance);
 }