public void Initialize(ClickerType type) { _autoClickerType = type; SetSillhouette(); SetButtonTextToCost(type); GetComponent<Button>().interactable = false; }
public void Initialize(GameMaster gameMaster, ClickerType clickerType) { ClickerType = clickerType; StackedClickers = 1; _gameMaster = gameMaster; SetNewMoveDirection(); _particleSystem = GetComponent<ParticleSystem>(); }
public ClickerType CloneWithRandom() { var newWithRandom = new ClickerType { Name = Name, MoveTime = GetWithRandomOffset(MoveTime), MoveSpeed = MoveSpeed, DigTime = GetWithRandomOffset(DigTime), Income = Income, Cost = Cost }; return newWithRandom; }
private void AddAutoClickerButtonToMenu(ClickerType type) { var button = Instantiate(BuyAutoClickerButton).GetComponent<Button>(); button.GetComponent<AutoClickerButton>().Initialize(type); button.onClick.AddListener(() => PlayerBuyAutoClicker(type.Name)); button.transform.SetParent(AutoClickerBuyWindow.transform, false); }
private void SetButtonTextToCost(ClickerType type) { gameObject.GetComponent<Button>().GetComponentInChildren<Text>().text = type.Cost.ToString(); }