コード例 #1
0
ファイル: GameManager.cs プロジェクト: XUWENJIExwj/SkyJump
    // Start is called before the first frame update
    void Awake()
    {
        // AudioManagerへのアタッチ
        if (!GameObject.Find("AudioManager"))
        {
            Instantiate(audioManagerPrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity).name = "AudioManager";
        }
        audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager>();

        objectCreator.audioManager      = audioManager;
        playerObjWithFlick.audioManager = audioManager;

        // SkinManagerへのアタッチ
        if (!GameObject.Find("SkinSupport"))
        {
            Instantiate(skinSupportPrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity).name = "SkinSupport";
        }
        skinSupport = GameObject.Find("SkinSupport").GetComponent <SkinSupport>();
        playerObjWithFlick.GetComponent <SpriteRenderer>().color = skinSupport.GetPlayerColor();

        // BGMの再生
        audioManager.PlayBGM(AudioManager.BGM.BGM_GAME);

        canvasManager.SetScorePosition(Screen.width / 2 - 300.0f, Screen.height / 2 * 0.9f);

        scoreFrame.transform.localPosition = score.transform.localPosition;
        scoreFrame.transform.localScale    = score.transform.localScale;

        fade.SetFadeState(Fade.FadeState.FADE_STATE_IN);
    }
コード例 #2
0
ファイル: TitleManager.cs プロジェクト: XUWENJIExwj/SkyJump
    // Start is called before the first frame update
    void Start()
    {
        screenWidth  = (float)Screen.width / 100;
        screenHeight = (float)Screen.height / 100;

        titleSpriteRenderer = GetComponent <SpriteRenderer>();

        titleSpriteRenderer.size = new Vector2(6.4f * screenHeight / 11.36f, screenHeight);

        // AudioManagerへのアタッチ
        if (!GameObject.Find("AudioManager"))
        {
            Instantiate(audioManagerPrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity).name = "AudioManager";
        }
        audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager>();
        skinManager.SetAudioManager(audioManager);

        // SkinManagerへのアタッチ
        if (!GameObject.Find("SkinSupport"))
        {
            Instantiate(skinSupportPrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity).name = "SkinSupport";
        }
        skinSupport = GameObject.Find("SkinSupport").GetComponent <SkinSupport>();
        skinManager.SetSkinSupport(skinSupport);
        skinManager.InitInTitleScene();

        // BGMの再生
        audioManager.PlayBGM(AudioManager.BGM.BGM_TITLE);

        if (deleteRank)
        {
            PlayerPrefs.DeleteAll();
        }

        rank.LoadRank();
        //rank.LoadRankBinary();

        if (rank.LoadChampionInfo().rank != 0)
        {
            best.SetActive(true);
            scoreBest.gameObject.SetActive(true);
            scoreBest.text = "Best Score : " + rank.LoadChampionInfo().score.ToString() + " m";
        }
        else
        {
            best.SetActive(false);
            scoreBest.gameObject.SetActive(false);
        }

        fade.SetFadeState(Fade.FadeState.FADE_STATE_IN);
    }
コード例 #3
0
 public void SetSkinSupport(SkinSupport skin_support)
 {
     skinSupport = skin_support;
 }
コード例 #4
0
ファイル: ResultManager.cs プロジェクト: XUWENJIExwj/SkyJump
    // Start is called before the first frame update
    void Start()
    {
        screenWidth  = (float)Screen.width / 100;
        screenHeight = (float)Screen.height / 100;

        resultSpriteRenderer = GetComponent <SpriteRenderer>();

        resultSpriteRenderer.size = new Vector2(6.4f * screenHeight / 11.36f, screenHeight);

        RectTransform frame = scoreFrame.GetComponent <RectTransform>();

        // AudioManagerへのアタッチ
        if (!GameObject.Find("AudioManager"))
        {
            Instantiate(audioManagerPrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity).name = "AudioManager";
        }
        audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager>();

        // SkinManagerへのアタッチ
        if (!GameObject.Find("SkinSupport"))
        {
            Instantiate(skinSupportPrefab, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity).name = "SkinSupport";
        }
        skinSupport = GameObject.Find("SkinSupport").GetComponent <SkinSupport>();
        player.GetComponent <SpriteRenderer>().color = new Vector4(
            skinSupport.GetPlayerColor().r * 140 / 255.0f,
            skinSupport.GetPlayerColor().g * 140 / 255.0f,
            skinSupport.GetPlayerColor().b * 140 / 255.0f,
            1.0f);

        if (canvasOldScene = GameObject.Find("Canvas"))
        {
            score = canvasOldScene.GetComponentInChildren <Score>();
            Destroy(canvasOldScene);
        }
        else
        {
            scoreOther.gameObject.SetActive(true);
            score       = scoreOther;
            score.tag   = "Score";
            score.score = 100;
        }

        score.transform.SetParent(scoreDisplay.transform);

        scoreBest.scoreIndex = score.scoreIndex;

        canvasManager.SetScorePosition(-40.0f, frame.anchoredPosition.y - 15.0f);
        canvasManager.SetScoreSize(0.65f, 0.65f);

        //rank.LoadRankBinary();

        rank.LoadRank();

        if (rank.CheckIfRankIn(score.score))
        {
            inputer.gameObject.SetActive(true);
            // 入力処理
            rank.SetNewRankInfo("Player", score.score);
            rank.SortRank();
            //rank.SortRankBinary();
        }

        scoreBest.SetScore((float)rank.LoadChampionInfo().score / score.scoreIndex);

        canvasManager.SetScoreBestPosition(45.0f, frame.anchoredPosition.y - 175.0f);
        canvasManager.SetScoreBestSize(0.48f, 0.48f);

        // BGMの再生
        audioManager.PlayBGM(AudioManager.BGM.BGM_RESULT);

        hasCreatedSoul = false;

        fade.SetFadeState(Fade.FadeState.FADE_STATE_IN);
    }