Esempio n. 1
0
 private void OnDestroy()
 {
     if (this.requirements != null)
     {
         PlayerLevelRequirement playerLevelRequirement = this.requirements;
         playerLevelRequirement.OnUnlock = (Action <bool>)Delegate.Remove(playerLevelRequirement.OnUnlock, new Action <bool>(this.OnUnlockActions));
     }
 }
Esempio n. 2
0
    private void OnEnable()
    {
        int requiredLevel = PlayerLevelRequirement.GetRequiredLevel(this.levelRequirementKey);

        if (requiredLevel >= 0)
        {
            this.levelRequirement = requiredLevel;
        }
        this.Lock(this.levelRequirement > Singleton <PlayerProgress> .Instance.Level);
        EventManager.Connect(new EventManager.OnEvent <PlayerProgressEvent>(this.OnPlayerProgressEvent));
    }
Esempio n. 3
0
 private void Awake()
 {
     this.methodToCall.PrepareCall();
     this.eventToSend.PrepareSend();
     if (this.skeletonAnimation.state == null)
     {
         this.skeletonAnimation.Initialize(true);
     }
     this.skeletonAnimation.state.Event += this.OnAnimationEvent;
     if (this.requirements != null)
     {
         PlayerLevelRequirement playerLevelRequirement = this.requirements;
         playerLevelRequirement.OnUnlock = (Action <bool>)Delegate.Combine(playerLevelRequirement.OnUnlock, new Action <bool>(this.OnUnlockActions));
     }
 }
Esempio n. 4
0
 private void OnPlayerChanged(PlayerChangedEvent data)
 {
     if (Singleton <PlayerProgress> .IsInstantiated())
     {
         if (Singleton <PlayerProgress> .Instance.Level < PlayerLevelRequirement.GetRequiredLevel("cake_race"))
         {
             Singleton <GameManager> .Instance.LoadMainMenu(false);
         }
         else
         {
             Singleton <GameManager> .Instance.LoadCakeRaceMenu(false);
         }
     }
     else
     {
         Singleton <GameManager> .Instance.LoadMainMenu(false);
     }
 }
Esempio n. 5
0
    private void OnReceivedUIEvent(UIEvent data)
    {
        if (data.type != UIEvent.Type.ClosedLootWheel)
        {
            return;
        }
        if (Singleton <IapManager> .IsInstantiated() && Singleton <IapManager> .Instance.IsShopPageOpened())
        {
            return;
        }
        if (SnoutCoinShopPopup.DialogOpen)
        {
            return;
        }
        int requiredLevel = PlayerLevelRequirement.GetRequiredLevel("cake_race");

        if (requiredLevel >= 0 && Singleton <PlayerProgress> .Instance.Level >= requiredLevel && !GameProgress.HasKey("CakeRaceUnlockShown", GameProgress.Location.Local, null))
        {
            GameProgress.SetBool("CakeRaceUnlockShown", false, GameProgress.Location.Local);
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.gameData.m_cakeRaceUnlockedPopup);
            gameObject.transform.position = WPFMonoBehaviour.hudCamera.transform.position + Vector3.forward * 2f;
        }
    }