public TankController(TankModel tankModel, TankView tankPrefab)
 {
     TankModel = tankModel;
     TankView  = Object.Instantiate(tankPrefab);
     TankView.Initalise(this);
     Debug.Log("tank view created", TankView);
 }
 public TankController(TankModel tankModel, TankView tankPrefab)
 {
     XPos      = Random.Range(40, -40);
     ZPos      = Random.Range(40, -40);
     TankModel = tankModel;
     TankView  = GameObject.Instantiate <TankView>(tankPrefab, new Vector3(XPos, 0f, ZPos), Quaternion.identity);
     // currentPosition =  this.TankView.transform.position;
     TankView.Init(this);
 }
Beispiel #3
0
 public TankModel(int x, int y, int orderNumber)
 {
     X = x;
     Y = y;
     this.orderNumber = orderNumber;
     ownHeight        = GameModel.tankImage.Height;
     ownWidth         = GameModel.tankImage.Width;
     tankView         = new Tank.TankView(currentDirection, new Point(X, Y));
 }
 protected virtual void Awake()
 {
     tankView = GetComponent <TankView>();
 }
 public void Enable()
 {
     TankView.Enable();
 }
 public void Disable()
 {
     TankView.Disable();
 }