Exemple #1
0
    void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        isChangingState                 = false;
        blackPanelAlpha.startValue      = 1f;
        blackPanelAlpha.endValue        = 0f;
        blackPanelAlpha.TweenCompleted += SceneFadeinFinishEvent;
        blackPanelAlpha.Begin();
        blackPanelAlpha.value = blackPanelAlpha.startValue;

        if (scene.buildIndex == (int)SCENE_INDEX.GAMESTAGE)
        {
            StageLoader.Instance().SetStage(StageLoader.NextStage);
            gameControlObj.SetActive(true);
            topCanvas.sortingOrder = 10;

            ReturnButton.SetActive(true);
            SettingShowButton.SetActive(true);

            if (StageLoader.CurrentStage == 1)
            {
                PlayerManager.Instance().playerController.isFainting = true;
            }

            GameManager.Instance().Time_LatestStartGame = DateTime.UtcNow;

            // #### TEST
            if (GameManager.Instance().IsTestMode)
            {
                testButton.gameObject.SetActive(true);
            }
            else
            {
                testButton.gameObject.SetActive(false);
            }
        }
        else
        {
            StageLoader.Instance().DisableStage();
            gameControlObj.SetActive(false);
            topCanvas.sortingOrder = 0;

            ReturnButton.SetActive(false);
            SettingShowButton.SetActive(false);

            testButton.gameObject.SetActive(false);
        }

        PlayerManager.Instance().IsTriggerEnding = false;

        StartBGM(scene);
        ChangeEnvironment(scene);
    }
Exemple #2
0
    public void OnGetShard(MemoryShard shard)
    {
        if (shard.GetShardType() == SHARD_TYPE.SHARD1 ||
            shard.GetShardType() == SHARD_TYPE.SHARD2)
        {
            int resultShardAmount = (int)(StageLoader.Instance().GetRandomShard(shard.GetShardType()) * StageLoader.Instance().GetShardMultifly());

            PlayerStatus.CurrentMemoryShards += resultShardAmount;
            playerController.ShowShardGetText(resultShardAmount);
        }

        TopMostControl.Instance().StartGlobalLightEffect(shard.GetShardTargetColor(), 0.5f, 0.1f);
        GetPlayerControl().BlinkPlayerShardLight(shard.GetShardTargetColor());
        SoundManager.PlayOneShotSound(SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_gainShard], SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_gainShard].clip);
    }
Exemple #3
0
    void OnClickUpgradeButton(SKILL_TYPE skillType)
    {
        // Upgrade Possible
        if ((GetRequiredShardsForUpgrade(skillType) <= PlayerManager.Instance().PlayerStatus.CurrentMemoryShards) &&
            (currentGameUIStatus == TOPUI_STATUS.GAMEOVER))
        {
            int requiredShards = GetRequiredShardsForUpgrade(skillType);

            PlayerManager.Instance().PlayerStatus.CurrentMemoryShards -= requiredShards;
            GameConfigs.SetCurrentMemoryShards(PlayerManager.Instance().PlayerStatus.CurrentMemoryShards);

            GameConfigs.SetSkillLevel(skillType, GameConfigs.SkillLevel(skillType) + 1);

            foreach (UpgradeElement element in upgradeElements)
            {
                element.SetInfo();
            }


            int effectShardAmount = (GameConfigs.SkillLevel(skillType) / 3) + 1;

            if (effectShardAmount < 1)
            {
                effectShardAmount = 1;
            }
            if (effectShardAmount > 10)
            {
                effectShardAmount = 10;
            }

            StageLoader.Instance().Generate_SkillUpgradeEffectShards(skillType, effectShardAmount);

            Vibration.Vibrate(3);
            StartGlobalLightEffect(Color.white, 1f, 0.2f);
            SoundManager.PlayOneShotSound(SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_powerUp], SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_powerUp].clip);

            if (onCameraShake != null)
            {
                onCameraShake(2);
            }
        }
    }
Exemple #4
0
    public void SetPlayerController(bool active, bool isRightInit = true)
    {
        if (playerController.transform.parent != this.transform)
        {
            playerController.transform.parent = this.transform;
        }

        playerController.gameObject.SetActive(active);

        if (active)
        {
            playerController.transform.position = StageLoader.Instance().GetCurrentStage().GetPlayerInitPos().position;

            Vector3 tVec = playerController.playerAnimator.transform.localScale;
            if ((isRightInit && tVec.x < 0) ||
                (!isRightInit && tVec.x > 0))
            {
                tVec.x *= -1;
                playerController.playerAnimator.transform.localScale = tVec;
            }
        }
    }