예제 #1
0
 private void Start()
 {
     config          = FindObjectOfType <IdleConfig>();
     defaultPosition = transform.position;
     SetupDecayColor();
     Reset();
 }
예제 #2
0
    void Start()
    {
        coins  = FindObjectOfType <Coins>();
        config = FindObjectOfType <IdleConfig>();

        InitializeUpgrades();
        coins.OnCoinsChanged += CoinsUpdatedHandler;
        CoinsUpdatedHandler(coins.GetCoins());
    }
예제 #3
0
 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();
 }
예제 #4
0
 // 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());
 }
예제 #5
0
파일: Coins.cs 프로젝트: Scaelz/Covfefe
 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();
 }
예제 #6
0
파일: IdleState.cs 프로젝트: Yann4/Thesis
 public IdleState(IdleConfig config) : base(config)
 {
     _idleConfig = config;
 }