示例#1
0
        void Start()
        {
            if (this._sequence == null || this._sequence.Length == 0)
            {
                this._sequence = FindObjectsOfType <GoalCellObserver>();
                Array.Sort(this._sequence, (g1, g2) => g1.OrderIndex.CompareTo(g2.OrderIndex));
            }

            Array.Reverse(this._sequence);
            this._goal_stack     = new Stack <GoalCellObserver>(this._sequence);
            this.CurrentGoalCell = this.PopGoal();
        }
        protected override void PreSetup()
        {
            var xs = this._grid_size.X;
            var ys = this._grid_size.Y;
            var zs = this._grid_size.Z;

            this._grid = this.GenerateRandomGrid(xs, ys, zs, this._min_empty_cells_percentage);

            this._goal_cell_observer = this.gameObject.GetComponent <GoalCellObserver>();

            //this.Setup();

            var dominant_dimension = Mathf.Max(xs, ys, zs);

            this._camera.orthographicSize   = dominant_dimension / 2f + 1f;
            this._camera.transform.position = new Vector3(0, ys / 2f + 1f, 0);
        }
示例#3
0
 public GoalCellObserver PopGoal()
 {
     this.CurrentGoalCell = this._goal_stack.Pop();
     return(this.CurrentGoalCell);
 }