Beispiel #1
0
    public void OnClickPortalPurchase()
    {
        if (currentSelectedPortalTrigger != null)
        {
            if (GameStatics.GetPortalOpenCost(currentSelectedPortalTrigger.portalType) <= PlayerManager.Instance().PlayerStatus.CurrentMemoryShards)
            {
                // Open the portal
                PlayerManager.Instance().PlayerStatus.CurrentMemoryShards -= GameStatics.GetPortalOpenCost(currentSelectedPortalTrigger.portalType);
                GameConfigs.SetPortalStatus(currentSelectedPortalTrigger.portalType, true);
                GameConfigs.SetCurrentMemoryShards(PlayerManager.Instance().PlayerStatus.CurrentMemoryShards);

                currentSelectedPortalTrigger.SetPortal(true);

                StartGlobalLightEffect(Color.magenta, 4f, 0.6f);
                SoundManager.PlayOneShotSound(SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_powerUp], SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_powerUp].clip);
                if (onCameraShake != null)
                {
                    onCameraShake(7);
                }
            }
        }
    }
Beispiel #2
0
 public void OnClickPortalOff()
 {
     GameConfigs.SetPortalStatus(GameStatics.PORTAL_TYPE.STAGE1_1, false);
     GameConfigs.SetPortalStatus(GameStatics.PORTAL_TYPE.STAGE2_1, false);
     GameConfigs.SetPortalStatus(GameStatics.PORTAL_TYPE.STAGE3_1, false);
 }