// Use this for initialization void Start() { this.fishing = this.fishingGameObject.GetComponent<IFishing> (); if (this.fishing == null) { throw new UnityException ("Fishing have not initialized"); } this.fishing.OnEarnedUpdate += (float money) => { this.textForEarnedMoney.text = money.ToString(); }; this.fishing.OnRequiredUpdate += (float money) => { this.textForRequiredMoney.text = money.ToString(); }; this.fishing.OnLevelUpdate += (ushort levelNum) => { this.textForLevelNumber.text = levelNum.ToString(); }; this.fishing.OnChangeLevelTime += (float time) => { this.textForTimeRemainded.text = time.ToString(); }; }
public void Init(IFishing fishing, ISea sea, IFisher fisher, Action method = null) { this.fishing = fishing; this.sea = sea; this.fisher = fisher; this.minimumMoneyBaseCoeff += 50 * (fishing.NumLevel - 1); this.fishing.OnEarnedUpdate += IncomeFunc; }
public void Use(IFisher fisher, ISea sea, IFishing fishing) { fisher.Power++; Debug.Log (fisher.Power); if (this.onUsed != null) { this.onUsed.Invoke (this); } }
public void Init(IFishing fishing, ISea sea, IFisher fisher, Action method = null) { this.fishing = fishing; this.sea = sea; this.fisher = fisher; // Пример понижения уровня //this.fishing.NumLevel--; }
public void Init(IFishing fishing, ISea sea, IFisher fisher, Action method = null) { this.fishing = fishing; this.sea = sea; this.fisher = fisher; this.totalObjectForDestroying = this.sea.CountOfCatchableObjects; this.sea.OnDestroyCatchableObject += Foo; }
public void Init(IFishing fishing, ISea sea, IFisher fisher, Action method = null) { this.fishing = fishing; this.sea = sea; this.fisher = fisher; this.fishAmount.Add ("BW Fish", 1); this.fishAmount.Add ("Yellow Fish", 2); this.fishAmount.Add ("Blue Fish", 1); this.sea.OnDestroyCatchableObject += Foo; }