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); }
public void CreateTank(int index) { TankModel model = new TankModel(tankList.tanks[index]); TankController tank = new TankController(model, tankView); }