示例#1
0
        private void Awake()
        {
            GameServices.Initialize();

            InitializeMainComponents();

            players = Player.Builder.Build(new string[] { "First guy", "Second guy" },
                                           new int[][] { new int[] { 1 }, new int[] { 0 } },
                                           null);

            var container = new FigureContainer();
            figureFactory = new FigureFactory(container);
            TurnController.Initialize(container);
        }
示例#2
0
        public virtual void Initialize(FigureContainer container, FigureData data)
        {
            this.container = container;
            jumpUpHeight = data.jumpUpHeight;
            jumpDownHeight = data.jumpDownHeight;

            angle = data.jumpingAngle * Mathf.Deg2Rad;
            pathFinder = new DijkstraPathFinder(jumpUpHeight, jumpDownHeight);
            body = GetComponent<Rigidbody>();
            Height = r.bounds.size.y;

            DefineStartHex(0.5f * r.bounds.size.y);

            container.OnFigureCreated((Figure)this);
        }
示例#3
0
 private TurnController(FigureContainer container)
 {
     this.container = container;
 }
示例#4
0
 public static void Initialize(FigureContainer container)
 {
     instance = new TurnController(container);
 }
示例#5
0
 public FigureFactory(FigureContainer container)
 {
     this.container = container;
     I = this;
 }
示例#6
0
        public override void Initialize(FigureContainer container, FigureData data)
        {
            base.Initialize(container, data);
            Owner = Player.GetByIndex(data.owner);

            //*!Crutch
            r.material = Resources.Load<Material>("Models/Materials/whiteMat");
            r.material.mainTexture = Resources.Load<Texture>("Models/whiteMat");
            r.material.color = data.color;
            //_

            InitStats(data);
            InitFight();
        }