// 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(); }); }
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); }
public void Cleanup() { gunShop = null; store = null; }
private void Awake() { button = GetComponent <Button>(); gunShop = FindObjectOfType <GunShop>(); }