Exemplo n.º 1
0
    void Start()
    {
        textLine  = musicSyncText.text.Split('\n');
        musicSync = new MusicSync[textLine.Length];

        for (int i = 0; i < textLine.Length; i++)
        {
            musicSync[i] = new MusicSync(0, string.Empty);

            string[] tempText = textLine[i].Split(',');

            musicSync[i].time = float.Parse(tempText[0]);

            //string 뒷부분에 null값이 자동으로 들어가기 때문에 마지막 null 삭제
            musicSync[i].direction = tempText[1].Substring(0, tempText[1].Length - 1);
            //string 마지막은 null이 생기지 않기때문에 예외처리  /  \n 예외처리
            for (int enumAmount = 0; enumAmount < 4; enumAmount++)
            {
                Direction tempDirection = (Direction)enumAmount;
                if (tempText[1].Length.Equals(tempDirection.ToString().Length) || i.Equals(textLine.Length - 1))
                {
                    musicSync[i].direction = tempText[1];
                    break;
                }
            }
        }

        StartCoroutine(MusicStart());
        StartCoroutine(MusicSyncSet());
    }
Exemplo n.º 2
0
    void Start()
    {
        charisma          = 70f;
        this.isFastFoward = false;

        portrait_animator = GameObject.FindWithTag("CharismaPortrait").GetComponent <Animator>();
        musicSync         = FindObjectOfType <MusicSync>();
    }
Exemplo n.º 3
0
    // Set up class fields
    void Init()
    {
        this.pauseScreen.SetActive(false); // disable pause screen at beginning of game
        this.isGamePaused = false;

        // tells LoadArcadeScene to load settings based on THIS scene
        LoadArcadeScene.sceneFrom = SceneManager.GetActiveScene().name;

        this.musicSync = FindObjectOfType <MusicSync>();
        this.input     = FindObjectOfType <PlayerInput>();

        UIInputHandler.Instance.OnPause.AddListener(PauseKeyPressed);
    }