private void Start() { config = FindObjectOfType <IdleConfig>(); defaultPosition = transform.position; SetupDecayColor(); Reset(); }
void Start() { coins = FindObjectOfType <Coins>(); config = FindObjectOfType <IdleConfig>(); InitializeUpgrades(); coins.OnCoinsChanged += CoinsUpdatedHandler; CoinsUpdatedHandler(coins.GetCoins()); }
private void Start() { config = FindObjectOfType <IdleConfig>(); coins = FindObjectOfType <Coins>(); renderer = GetComponent <MeshRenderer>(); material = renderer.material; config.OnAddCoins += CoinsAddedHandler; config.OnMinusCoins += CoinsAddedHandler; SetConvertedPrice(workPlace.price); CoinsAddedHandler(0); LoadPrefs(); }
// Start is called before the first frame update void Start() { config = FindObjectOfType <IdleConfig>(); if (PlayerPrefs.GetString(PrefsUtils.onlineDate) != "") { int cachboxCount = PlayerPrefs.GetInt(PrefsUtils.cashbox) + 1; float avSpeed = GetAverageWorkTime(cachboxCount); //Debug.Log(avSpeed); //Debug.Log(cachboxCount); //Debug.Log(config.coinsClickValue); CalculateOfflineIncome(avSpeed, cachboxCount, config.coinsClickValue); } else { HideVisual(); } StartCoroutine(SaveOnline()); }
private void Awake() { /* * if (Instance == null) * { * Instance = this; * } * else * { * Destroy(gameObject); * } */ coins = PlayerPrefs.GetFloat(PrefsUtils.money); _coins = FindObjectOfType <IdleConfig>(); _coins.OnAddCoins += AddCoins; _coins.OnMinusCoins += MinusCoins; _coins.OnAddCoins += SaveProgress; _coins.OnMinusCoins += SaveProgress; SetCoinsText(); }
public IdleState(IdleConfig config) : base(config) { _idleConfig = config; }