예제 #1
0
    private void OnChestOpened()
    {
        RewardPopupChest rewardChest = popupController.RewardChest;

        rewardChest.ChestOpenedAction = (System.Action)Delegate.Remove(rewardChest.ChestOpenedAction, new System.Action(OnChestOpened));
        screenComplete();
    }
예제 #2
0
    private void onChestLand()
    {
        RewardPopupChest rewardChest = RewardChest;

        rewardChest.ChestLandAction = (System.Action)Delegate.Remove(rewardChest.ChestLandAction, new System.Action(onChestLand));
        RewardPopupAnimator.SetTrigger("ChestLands");
        isChestLanded = true;
    }
예제 #3
0
 public override void OnClick()
 {
     if (popupController.isChestLanded)
     {
         RewardPopupChest rewardChest = popupController.RewardChest;
         rewardChest.ChestOpenedAction = (System.Action)Delegate.Combine(rewardChest.ChestOpenedAction, new System.Action(OnChestOpened));
         popupController.RewardChest.ChestAnimator.SetTrigger("ChestOpen");
         popupController.RewardPopupAnimator.SetTrigger("ChestOpen");
     }
 }
예제 #4
0
 public override void OnClick()
 {
     if (popupController.PopupData.PopupType != DRewardPopup.RewardPopupType.replay && popupController.isChestLanded)
     {
         RewardPopupChest rewardChest = popupController.RewardChest;
         rewardChest.ChestOpenedAction = (System.Action)Delegate.Combine(rewardChest.ChestOpenedAction, new System.Action(OnChestOpened));
         popupController.RewardChest.ChestAnimator.SetTrigger("ChestOpen");
         popupController.RewardPopupAnimator.SetTrigger("ChestOpen");
         if (OpenButton != null)
         {
             OpenButton.SetActive(value: false);
         }
     }
     else if (popupController.PopupData.PopupType == DRewardPopup.RewardPopupType.replay)
     {
         screenComplete();
         Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.EnableUIElementGroup("MainNavButtons"));
     }
 }
예제 #5
0
    private IEnumerator loadChestPrefab()
    {
        PrefabContentKey          chestContentKey = (!string.IsNullOrEmpty(popupData.MascotName) && popupData.PopupType != DRewardPopup.RewardPopupType.levelUp) ? Service.Get <MascotService>().GetMascot(popupData.MascotName).Definition.RewardPopupChestContentKey : defaultChestKey;
        AssetRequest <GameObject> assetRequest    = Content.LoadAsync(chestContentKey);

        yield return(assetRequest);

        GameObject chestGO = UnityEngine.Object.Instantiate(assetRequest.Asset);

        chestGO.transform.SetParent(ChestParent, worldPositionStays: false);
        RewardChest = chestGO.GetComponent <RewardPopupChest>();
        RewardPopupChest rewardChest = RewardChest;

        rewardChest.ChestLandAction = (System.Action)Delegate.Combine(rewardChest.ChestLandAction, new System.Action(onChestLand));
        string animationTrigger = "LevelUp";

        if (popupData.PopupType == DRewardPopup.RewardPopupType.questComplete || popupData.PopupType == DRewardPopup.RewardPopupType.generic)
        {
            animationTrigger = "Quest";
        }
        ParachuteAnimator.SetTrigger(animationTrigger);
        RewardChest.ChestAnimator.SetTrigger(animationTrigger);
    }