bool starAnimation(int value, ref List <int> list, Slider sliderStatus, Func <float, bool> animationMethod) { if (sliderStatus.maxValue == sliderStatus.value) { eugenioController.playNegation(); return(false); } StarTextController instanceStarTextController = StarTextController.instance; StarImageController starImageController = StarImageController.instance; int result = instanceStarTextController.changeStarText(value); if (result > 0) { animationMethod(3f); starImageController.playStarImage(); user.Stars_qty = result; if (list.Count != 0) { updateStatus(value, ref list, sliderStatus); } else { updateStatus(value, sliderStatus); } return(true); } else { eugenioController.playNegation(); return(false); } }
void Awake() { if (mInstance == null) { mInstance = this as StarImageController; } animator = GetComponent <Animator>(); }
void Awake() { foodsPrices = new List <int> (); baloonAnimator = GameObject.Find("Baloon").GetComponent <Animator> (); StarTextController starTextController = StarTextController.instance; StarImageController starImageController = StarImageController.instance; eugenioController = GetComponent <EugenioController>(); thoughtsController = GetComponentInChildren <Thoughts> (); user = User.getInstance; MainCategory userCurrentCategory = ((MainCategory)user.CurrentCategory); if (userCurrentCategory != null) { int diffLevel = userCurrentCategory.Level - user.Level_pet; if (diffLevel > 0) { while (diffLevel > 0) { user.Level_pet++; eugenioController.upgradeUser(); diffLevel--; } user.CurrentStage = 1; GameObject applicationManager = GameObject.FindGameObjectWithTag("ApplicationManager"); DataAccess dataAccess = applicationManager.GetComponent <DataAccess> (); dataAccess.getAvailableFoods(); dataAccess.getAvailableGames(); dataAccess.trySaveUserInformationsOnDB(); } } starTextController.updateStarValue(user.Stars_qty); }