Ejemplo n.º 1
0
        public override void OnNotificationReceived(Notification notification, NotificationParam optionalObject = null)
        {
            switch (notification)
            {
            case Notification.StartCameraScript:
                _target   = App.GetData().GetComponent <GameCommonData>().player;
                runScript = true;
                break;

            case Notification.StartZoomingCamera:
                zoom = true;
                break;

            case Notification.StopZoomingCamera:
                zoom = false;
                break;

            case Notification.StopCameraScript:
                runScript = false;
                break;
            }
        }
Ejemplo n.º 2
0
        public override void OnNotificationReceived(Notification notification, NotificationParam param = null)
        {
            switch (notification)
            {
            case Notification.LoadGame:
                HideAllPopUps();
                break;

            case Notification.ShowPopup:
                ShowPopUp((PopUpType)param.intData["popUpType"]);
                break;

            case Notification.HidePopUp:
                HidePopup((PopUpType)param.intData["popUpType"], param.boolData["isHidingSilent"]);
                break;

            case Notification.HideAllPopUps:
                HideAllPopUps();
                break;

            case Notification.PopUpButtonPressed:
                OnPopUpButtonPressed(
                    (PopUpType)param.intData["type"],
                    (PopUpButtonActions)param.intData["action"]);
                break;

            case Notification.PopUpHidden:
                break;

            case Notification.SetUi:
                HideAllPopUps();
                break;

                // case Notification.ChangeStage:
                //     HidePopup(PopUpType.StageComplete);
                //     break;
            }
        }
Ejemplo n.º 3
0
        public override void OnNotificationReceived(Notification notification, NotificationParam param = null)
        {
            switch (notification)
            {
            case Notification.UnitsUpdated:
                EvaluateInfos();
                break;

            case Notification.IdleButtonPressed:
                HandleButtonPressed((IdleUnitType)param.intData[0]);
                break;

            case Notification.IdleButtonFillStarted:
                HandleTimerOfInfo((IdleUnitType)param.intData[0], isStarted: true);
                EvaluateInfos();
                break;

            case Notification.IdleButtonFillComplete:
                HandleTimerOfInfo((IdleUnitType)param.intData[0], isStarted: false);
                EvaluateInfos();
                break;
            }
        }
Ejemplo n.º 4
0
        public override void OnNotificationReceived(Notification notification, NotificationParam param = null)
        {
            switch (notification)
            {
            case Notification.GameLoaded:
                if (!App.GetLevelData().IsLogicPopulated)
                {
                    if (App.GetLevelData().LogicData != null)
                    {
                        for (int i = 0; i < App.GetLevelData().LogicData.Count; i++)
                        {
                            App.GetLevelData().LogicData[i].fulfillmentStatus = LogicStatus.Unfulfilled;
                        }
                        App.GetLevelData().IsLogicPopulated = true;
                    }
                }
                break;

            case Notification.UpdateLogic:
                HandleLogicUpdate((LogicType)param.intData[0], (LogicStatus)param.intData[1]);
                break;
            }
        }
Ejemplo n.º 5
0
        public void HidePopUp()
        {
            OnPopUpStartingToHide?.Invoke();

            _isPopUpReady = false;
            _bg.DOScale(new Vector3(0, 0, 0), 0.2f).OnComplete(() => InitializePopUp()).SetEase(Ease.InBack).OnComplete(
                () =>
            {
                for (int i = 0; i < _blurBGs.Length; i++)
                {
                    _blurBGs[i].gameObject.Hide();
                }

                OnPopUpHidden?.Invoke();

                NotificationParam popUp = new NotificationParam(Mode.intData);
                popUp.intData["type"]   = (int)_type;

                OnResetPopUp?.Invoke();

                App.Notify(Notification.PopUpHidden, popUp);
            });
        }
Ejemplo n.º 6
0
        private IEnumerator StartAction(UiScreenElements[] uiScreenElements, ShowHideAction showHideAction)
        {
            for (int i = 0; i < uiScreenElements.Length; i++)
            {
                for (int j = 0; j < uiScreenElements[i].elements.Length; j++)
                {
                    yield return(new WaitForSecondsRealtime(uiScreenElements[i].elements[j].waitBefore));

                    for (int k = 0; k < uiScreenElements[i].elements[j].elements.Length; k++)
                    {
                        if (uiScreenElements[i].elements[j].hasEffectWord)
                        {
                            LetDoTweenHandleShowHide(uiScreenElements[i].elements[j].elements[k], uiScreenElements[i].elements[j].effectWord);
                        }
                        else
                        {
                            switch (showHideAction)
                            {
                            case ShowHideAction.Show:
                                uiScreenElements[i].elements[j].elements[k].Show();
                                break;

                            case ShowHideAction.Hide:
                                uiScreenElements[i].elements[j].elements[k].Hide();
                                break;
                            }
                        }
                        yield return(new WaitForSecondsRealtime(uiScreenElements[i].elements[j].waitInBetween));
                    }
                    yield return(new WaitForSecondsRealtime(uiScreenElements[i].elements[j].waitAfter));
                }
            }
            NotificationParam param = new NotificationParam(Mode.intData);

            param.intData.Add((int)screenType);
            App.GetNotificationCenter().Notify(Notification.TransitionComplete, param);
        }
Ejemplo n.º 7
0
        private void HandleButtonPressed(IdleUnitType unitType)
        {
            IdleInfo info = App.GetIdleData().GetInfo(unitType);

            App.GetLevelData().unitsToBeAddedNextTick += info.defaultUnitIncreasePerSecond * info.permanentMultiplier *
                                                         (int)App.GetLevelData().currentMultiplier;
            IdleCurrency unit = App.GetLevelData().Unit;

            unit = unit - info.nextCost.cost.cost;
            if (unit < 0)
            {
                unit = 0;
            }
            App.GetLevelData().Unit = unit;
            //Formula for upgrading cost
            IdleCurrency currentCost = info.nextCost.cost.cost;

            if (info.hasAdsForCost)
            {
                if (info.alwaysVideo)
                {
                    info.nextCost.isVideo = true;
                }
                else
                {
                    info.currentCountOfTap++;
                    if (info.currentCountOfTap >= info.adsEveryHowManyTap)
                    {
                        info.nextCost.isVideo = true;
                    }
                    else
                    {
                        info.nextCost.isVideo = false;
                        IdleCurrency priceOnBaseCost = info.data.baseCost * info.data.percentageOnBaseCost;
                        priceOnBaseCost *= 0.01f;
                        IdleCurrency priceOnNewCost = currentCost * info.data.percentageOnNewCost;
                        priceOnNewCost          *= 0.01f;
                        info.nextCost.cost.cost += (priceOnBaseCost + priceOnNewCost);
                    }
                }
            }
            else
            {
                info.nextCost.isVideo = false;
                IdleCurrency priceOnBaseCost = info.data.baseCost * info.data.percentageOnBaseCost;
                priceOnBaseCost *= 0.01f;
                IdleCurrency priceOnNewCost = currentCost * info.data.percentageOnNewCost;
                priceOnNewCost          *= 0.01f;
                info.nextCost.cost.cost += (priceOnBaseCost + priceOnNewCost);
            }

            int addition = (int)App.GetLevelData().currentMultiplier;

            D.Log($"addition is {addition}");
            info.currentCount += addition;

            info.growth.currentSliderValue = 0;
            for (int i = 0; i < info.currentCount; i++)
            {
                if (i < info.growth.firstHalfClicks)
                {
                    info.growth.currentSliderValue += info.growth.firstHalfGrowthRate;
                }
                else
                {
                    info.growth.currentSliderValue += info.growth.lastHalfGrowthRate;
                }
            }

            if (info.data.hasTimerBeforeNextClick)
            {
                NotificationParam param = new NotificationParam(Mode.intData);
                param.intData.Add((int)info.unitType);
                App.Notify(Notification.StartBlockIng, param);
            }
            App.Notify(Notification.UnitsUpdated);
        }
Ejemplo n.º 8
0
 public abstract void OnNotificationReceived(Notification notification, NotificationParam param = null);
Ejemplo n.º 9
0
 private void DisplayInformation(NotificationParam param)
 {
     D.Log($"My name is {param.stringData["myName"]}, my age is {param.intData["myAge"]} and I am a " +
           $"{(param.boolData["isMale"] ? "Male" : "Female")}");
     D.Log($"Another integer is {param.intData["anotherInt"]}");
 }
Ejemplo n.º 10
0
 public void Update(long id, NotificationParam param)
 {
     Data.Entity.Notification oldEntity = Dao.Find(id);
     Data.Entity.Notification newEntity = ParamConverter.Convert(param, oldEntity);
     Dao.Update(newEntity);
 }
Ejemplo n.º 11
0
 public NotificationResult Create(NotificationParam param)
 {
     Data.Entity.Notification entity = ParamConverter.Convert(param, null);
     entity = Dao.Save(entity);
     return(ResultConverter.Convert(entity));
 }
 public void ValidateParameters(NotificationParam param)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 13
0
 public void Notify(Notification notification, NotificationParam param = null)
 {
     notificationCenter.Notify(notification, param);
 }
Ejemplo n.º 14
0
 public override void OnNotificationReceived(Notification notification, NotificationParam param = null)
 {
 }
Ejemplo n.º 15
0
        public override void OnNotificationReceived(Notification notification, NotificationParam param = null)
        {
            switch (notification)
            {
            case Notification.GameLoaded:
                if (!App.GetData <LevelCommonData>().IsSfxOn)
                {
                    sfxMute = true;
                }
                else
                {
                    sfxMute = false;
                }

                if (!App.GetData <LevelCommonData>().IsMusicOn)
                {
                    musicMute    = true;
                    wasMusicMute = true;
                }
                else
                {
                    musicMute = false;
                }
                PlayPauseBGAsPerSavedData();
                break;

            case Notification.DataChanged:
                if (!App.GetData <LevelCommonData>().IsSfxOn)
                {
                    sfxMute = true;
                }
                else
                {
                    sfxMute = false;
                }

                if (!Engine.Core.ApplicationRelated.App.GetData <LevelCommonData>().IsMusicOn)
                {
                    musicMute    = true;
                    wasMusicMute = true;
                }
                else
                {
                    musicMute = false;
                }
                PlayPauseBGAsPerSavedData();
                break;

            case Notification.StartUnlocking:
                if (!sfxMute)
                {
                    AudioInfo source = GetAudioInfoAsPerType(AudioType.LevelComplete);
                    if (source != null)
                    {
                        source.source.Play();
                    }
                }
                break;

            case Notification.ButtonPressed:
                if (!sfxMute)
                {
                    AudioInfo source = GetAudioInfoAsPerType(AudioType.Button);
                    if (source != null)
                    {
                        source.source.Play();
                    }
                }
                break;

            case Notification.FlyingObjectsReached:
                if (!sfxMute)
                {
                    GameObject gObj = Instantiate(tringSource, tringHolder);
                    Destroy(gObj, 1f);
                }
                break;

            case Notification.ElementDropped:
                if (!sfxMute)
                {
                    AudioInfo source = GetAudioInfoAsPerType(AudioType.Drop);
                    if (source != null)
                    {
                        source.source.Play();
                    }
                }
                break;
            }
        }
Ejemplo n.º 16
0
        public override void OnNotificationReceived(Notification notification, NotificationParam param = null)
        {
            switch (notification)
            {
            // // case Notification.GameLoaded:
            // //     D.Log("GAME LOADED");
            // //
            // //     break;
            //
            case Notification.RewardVideoSeenAnalytics:
                SendRVAnalytics(App.GetData <AdsData>().rvType);
                break;

            case Notification.HistoryUnlockedAnalytics:
                SendHistoryUnlockedAnalytics(param.intData["level"]);
                break;

                //
                // case Notification.RRVSeenAnalytics:
                //     SendRRVAnalytics(App.GetLevelData().rvPlacementType, (RRVType) param.intData[0]);
                //     break;
                //
                // case Notification.InterstitialSeenAnalytics:
                //     SendInterstitialAnalytics(RewardPlacementType.GameplayScreen);
                //     break;
                //
                // case Notification.TutorialCompletedAnalytics:
                //     SendTutorialCompleteAnalytics();
                //     break;
                //
                // case Notification.ExerciseUnlockedAnalytics:
                //     SendExerciseAnalytics((int)param.floatData[0]);
                //     break;
                //
                // case Notification.WeightMilestoneAnalytics:
                //     SendWeightMilestoneAnalytics(param.floatData[0]);
                //     break;
                //
                // case Notification.DehydratedAnalytics:
                //     SendDehydrationAnalytics();
                //     break;
                //
                // case Notification.OfflineWeightAnalytics:
                //     SendOfflineWeightAnalytics(param.floatData[0], param.floatData[1], param.floatData[2]);
                //     break;
                //
                // case Notification.HardCurrencyAnalytics:
                //     SendHCUsed(param.stringData[0], param.stringData[1]);
                //     break;
                //
                // case Notification.TimeTravelAnalytics:
                //     SendTTUsed(param.floatData[0]);
                //     break;
                //
                // case Notification.FemaleAccessedAnalytics:
                //     SendFemaleAccessed();
                //     break;
                //
                // case Notification.BlackMaleAccessedAnalytics:
                //     SendBlackMaleAccessed();
                //     break;
                //
                // case Notification.BlackFemaleAccessedAnalytics:
                //     SendBlackFemaleAccessed();
                //     break;
                //
                // case Notification.RV20Analytics:
                //     SendRV20();
                //     break;
                //
                // case Notification.RV30Analytics:
                //     SendRV30();
                //     break;
                //
                // case Notification.IAPAnalyticsYes:
                //     SendIAPYes();
                //     break;
                //
                // case Notification.IAPAnalyticsNo:
                //     SendIAPNo();
                //     break;
                //
                // case Notification.ObjectiveCompleted:
                //     SendObjectiveCompleted(param.stringData[0]);
                //     break;
                //
                // case Notification.ClaimDailyRewardAnalytics:
                //     HandleDailyClaim(param.intData[0], param.stringData[0], ClaimType.Regular);
                //     break;
                //
                // case Notification.ClaimDailyRewardDiamondAnalytics:
                //     HandleDailyClaim(param.intData[0], param.stringData[0], ClaimType.Diamond);
                //     break;
                //
                // case Notification.ClaimDailyRewardVideoAnalytics:
                //     HandleDailyClaim(param.intData[0], param.stringData[0], ClaimType.Video);
                //     break;
                //
                // case Notification.IsFirstAppLaunch:
                //     SendFirstAppLaunch();
                //     break;
                //
                // case Notification.ABPanelFirstJoin:
                //     SendABFirstAnalytics(param.stringData[0]);
                //     break;
                //
                // case Notification.ABPanelJoin:
                //     SendABAnalytics(param.stringData[0]);
                //     break;
                //
                // case Notification.AccessoriesUnlocked:
                //     SendAccessoriesUnlocked((AccessoriesType) param.intData[0]);
                //     break;
                //
                // case Notification.AccessoriesEquip:
                //     SendAccessoriesEquipped((AccessoriesType) param.intData[0]);
                //     break;
                //
                // case Notification.AccessoriesUnequip:
                //     SendAccessoriesUnequipped((AccessoriesType) param.intData[0]);
                //     break;
            }
        }