Exemple #1
0
        public virtual void AddButton(PreviewReplay replay)
        {
            var button = buttonTemplate.CreateReplayButton(
                transform,
                replay);

            buttons.Add(button);

            AdjustContent();

            button.gameObject.SetActive(true);

            button.OnAddedHandler += () => AddButton(select.CreateNextLabyrinth());

            button.OnRemovedHandler += OnButtonRemoved;
        }
Exemple #2
0
        public ReplayButton CreateReplayButton(
            Transform parent,
            PreviewReplay replay)
        {
            var button = this.Create(parent);

            button.gameObject.SetActive(true);

            button.replay                            = replay;
            button.rawImage.texture                  = replay.LabyrinthObject.Camera.RenderTexture;
            button.roundNumberText.text              = (replay.LevelNumber + 1).ToString();
            button.replay.OnMoveIndexChangedHandler += (x) => button.stepText.text = x.ToString();

            button.replay.OnAlgorithmChangedHandler += () => button.stepText.text = button.replay.MoveIndex.ToString();
            button.stepText.text = replay.MoveIndex.ToString();

            button.algorithmSelection.Algorithm.Set(replay.Level.Algorithm.Id);


            return(button);
        }
Exemple #3
0
 public virtual Labyrinths.UI.BaseButton Create(
     Transform parent,
     PreviewReplay replay)
 {
     return(CreateReplayButton(parent, replay));
 }