Esempio n. 1
0
 // Start is called before the first frame update
 void Start()
 {
     gunShop = gunShop_List.GetComponent <GunShop>();
     //LeftBtn.onClick.AddListener(delegate { gameObject.GetComponentInChildren<GunShop>().Prev(); });
     //RightBtn.onClick.AddListener(delegate { gameObject.GetComponentInChildren<GunShop>().Next(); });
     LeftBtn.onClick.AddListener(delegate { gunShop.Prev(); });
     RightBtn.onClick.AddListener(delegate { gunShop.Next(); });
 }
Esempio n. 2
0
 public void Initialize()
 {
     store = new Store();
     store.Add(GunFactory.Instance.Construct(new AK47Builder()));
     store.Add(GunFactory.Instance.Construct(new MP5Builder()));
     store.Add(GunFactory.Instance.Construct(new M1911Builder()));
     store.Add(GunFactory.Instance.Construct(new M870Builder()));
     gunShop = new GunShop(store);
 }
Esempio n. 3
0
 public void Cleanup()
 {
     gunShop = null;
     store   = null;
 }
 private void Awake()
 {
     button  = GetComponent <Button>();
     gunShop = FindObjectOfType <GunShop>();
 }