Exemplo n.º 1
0
    private void FixedUpdate()
    {
        if (!_isHit)
        {
            _notesize.y += _reduceValue * Time.deltaTime; // 일정 값만큼 y를 늘리고
            _notesize.x  = _notesize.y * _sizeratio;      // 그 y의 비례한 값만큼 x를 늘린다

            if (_notesize.x <= _maxnotesize.x)
            {
                _noteImage.rectTransform.sizeDelta = _notesize;
            }

            #region AUTOMODE
            if (PlayMusicInfo.ReturnAutoMode())
            {
                if (_notesize.x >= _maxnotesize.x)
                {
                    Hit("AWESOME");
                }
            }
            else
            {
                if (_notesize.x > _maxnotesize.x + _missRange)
                {
                    Hit("MISS");
                }
            }
            #endregion
        }
    }
Exemplo n.º 2
0
    public void GetCutScene()
    {
        // 노래에 맞는 컷씬 연출 프리팹 가져오기
        _animator = Resources.Load <Animator>("Cutscene/" + PlayMusicInfo.ReturnSongName() + "/" + PlayMusicInfo.ReturnSongName());
        if (_animator == null)
        {
            gameObject.SetActive(false);
            return;
        }

        gameObject.SetActive(true);
        _animator = Instantiate(_animator);
        _animator.transform.SetParent(transform, false);

        // 컷씬 타이밍 저장 파일 가져오기
        List <string> _tempstringList = FileManager.ReadFile_TXT(PlayMusicInfo.ReturnSongName() + "_CS.txt", "Cutscene/" + PlayMusicInfo.ReturnSongName() + "/");

        // 타이밍 파일이 존재하는 경우에만 타임스탬프를 저장한다.
        if (_tempstringList != null)
        {
            // 갯수에 맞게 저장 후
            _timeStamp = new float[_tempstringList.Count];
            // 파싱
            for (int i = 0; i < _timeStamp.Length; i++)
            {
                _timeStamp[i] = float.Parse(_tempstringList[i]);
            }
        }
    }
Exemplo n.º 3
0
 private void Awake()
 {
     _toggle = GetComponent <Toggle>();
     if (PlayMusicInfo.ReturnAutoMode())
     {
         _toggle.isOn = true;
     }
 }
Exemplo n.º 4
0
    private void Init(ShortNote _prefab, Queue <ShortNote> _inputQueue, string _objName, int turnNum)
    {
        ShortNote temp = Instantiate(_prefab, Vector2.zero, Quaternion.identity);

        temp.SetNoteProperties(float.Parse(value[0]), float.Parse(value[1]), PlayMusicInfo.ReturnAutoMode()); // 판정선거리, 감소속도
        temp.transform.SetParent(gameObject.transform, false);
        temp.name = _objName + " (" + turnNum.ToString() + ")";
        _inputQueue.Enqueue(temp);
    }
Exemplo n.º 5
0
 public Motion(string[] _motionInfo, Vector2 _characterPos)
 {
     string[] temp;
     _sprite = CharacterManager.instance.GetSprite(_motionInfo[0]);
     for (int i = 1; i < 12; i++) // 인덱스는 1부터 시작,
     {
         temp = _motionInfo[i].Split('/');
         joint.Add(PlayMusicInfo.ReturnJointName(i - 1), new Vector2(int.Parse(temp[0]) + _characterPos.x, int.Parse(temp[1]) + _characterPos.y));
     }
 }
Exemplo n.º 6
0
 public void OnPointerClick(PointerEventData eventData)
 {
     PlayMusicInfo.AppendMusicInfo(_monsterType);         // 노래의 세부타입을 설정함
     NotePoolingManager.instance.ReadNoteFile();          // 노트 풀링을 가져옴
     CutSceneManager.instance.GetCutScene();              // 최종 선택된 노래의 컷씬파일을 가져옴
     MonsterManager.instance.ChoiceMonster(_monsterType); // 상호작용을 시작할 몬스터를 설정해줌
     AttackMotionManager.instance.GetMotion();            // 최종 선택된 노래의 모션파일을 가져옴
     MonsterManager.instance.StartMusic();                // 게이지 활성화 및 장막 투명화
     SetNote.instance.ReadNoteFile();                     // 최종 선택된 노래의 채보파일을 읽어오면서 게임 시작
     _animator.enabled    = false;
     _image.raycastTarget = false;
 }
Exemplo n.º 7
0
 public void ChoiceSong(AudioClip _song, float _highlightpos, string _gameMode)
 {
     if (_choiceSongname == _song.name) // 이전에 선택한 악곡과 같은 이름 -> 2번 동시 터치
     {
         SoundManager.instance.ResetStartTime();
         SoundManager.instance.Stop();
         PlayMusicInfo.InputMusicInfo(_song.name);
         SceneManager.LoadScene(_gameMode);
     }
     else
     {
         _choiceSongname = _song.name;                              // 선택한 악곡의 파일명으로 변경
         SoundManager.instance.PlayPreListen(_song, _highlightpos); // 새로운 미리듣기 음악으로 변경
     }
 }
Exemplo n.º 8
0
    public void ReadNoteFile()
    {
        #region ReadNoteFIle
        // 채보 파일을 읽어온다
        List <string> _tempStringList = FileManager.ReadFile_TXT(PlayMusicInfo.ReturnSongName() + ".txt", "Notes/");
        if (_tempStringList != null)                                                                                              // 채보 파일을 읽어오는 데 성공하면
        {
            string[] _getInfo = _tempStringList[0].Split('/');                                                                    // 판정선간격, 감소속도, 롱노트진행속도 (첫줄)
            _songDelay = float.Parse(_getInfo[0]) / (float.Parse(_getInfo[1]) * Time.fixedDeltaTime) / (1 / Time.fixedDeltaTime); // 노트 활성화 간격 조정

            for (int i = 1; i < _tempStringList.Count; i++)
            {
                _getInfo = _tempStringList[i].Split('/');
                if (_getInfo.Length == 4)
                {
                    _note.Add(new Note(float.Parse(_getInfo[0]), _getInfo[1], _getInfo[2], _getInfo[3])); // 시간, 관절, 노트, 효과음
                }
                else
                {
                    _note.Add(new Note(float.Parse(_getInfo[0]), _getInfo[1], _getInfo[2], _getInfo[3], _getInfo[4])); // 시간, 관절, 노트, 효과음, 모션
                }
            }
            Invoke("StartMusic", 3.0f); // 3초 뒤 음악 재생
        }
        #endregion
        #region ReadMotionFile
        _tempStringList = FileManager.ReadFile_TXT("Motion_posInfo.csv", "", true);

        for (int i = 0; i < _tempStringList.Count; i++)
        {
            string[] _t = _tempStringList[i].Split(',');
            _motion.Add(_t[0], new Motion(_t, transform.position));
        }
        #endregion
        #region InputJointObject
        for (int i = 0; i < _joints.Length; i++)
        {
            _jointPoints.Add(_jointName[i], _joints[i]);
        }
        #endregion

        InvokeRepeating("FSM_IDLE", 0, 0.1f);
    }
Exemplo n.º 9
0
    public void GetMotion()
    {
        string        _path           = "AttackMotion/" + PlayMusicInfo.ReturnSongName(); // 연출을 보여줄 타이밍이 저장된 파일을 가져온다
        List <string> _tempstringList = FileManager.ReadFile_TXT(_path + "/timestamp.txt");

        if (_tempstringList != null)
        {
            // 갯수에 맞게 저장 후
            _timeStamp = new float[_tempstringList.Count];
            // 파싱
            for (int i = 0; i < _timeStamp.Length; i++)
            {
                _timeStamp[i] = float.Parse(_tempstringList[i]);
            }
        }

        _success = Resources.Load <RuntimeAnimatorController>(_path + "/Success"); // 방어 연출을 보여줄 애니메이션을 가져온다
        _fail    = Resources.Load <RuntimeAnimatorController>(_path + "/Fail");    // 공격 연출을 보여줄 애니메이션을 가져온다

        SetTime();
    }
Exemplo n.º 10
0
    private void FixedUpdate()
    {
        if (_isMove)
        {
            transform.position = Vector2.Lerp(_departPos, _arrivePos.position, _lerpValue);
            _lerpValue        += 300 * 0.000033f;

            if (PlayMusicInfo.ReturnAutoMode())
            {
                if (Vector2.Distance(_arrivePos.position, transform.position) < 50f)
                {
                    Success();
                }
            }
            if (transform.position == _arrivePos.position)
            {
                FAIL("MISS");
                _isMove = false;
            }
        }
    }
Exemplo n.º 11
0
    public void StartMusic()
    {
        ActiveGauge(_redM_gauge);
        // ActiveGauge(_blueM_gauge);
        InvokeRepeating("PullCurtain", 0f, 0.05f);

        List <string> _tempstringList = FileManager.ReadFile_TXT(PlayMusicInfo.ReturnSongName() + ".txt", "Monster/");

        if (_tempstringList != null)
        {
            for (int i = 0; i < _tempstringList.Count; i++)
            {
                string[] temp = _tempstringList[i].Split('/');
                _monsterState.Add(new MonsterState(temp[0], temp[1], temp[2]));
            }
            _tempstringList = null;
        }
        else
        {
            _monsterState = null;
        }
    }
Exemplo n.º 12
0
 private void FixedUpdate()
 {
     if (!_isJudgeEnd)
     {
         if (!_isTouch)
         {
             _lineSize.x -= _reduceValue * Time.deltaTime;
             _lineSize.y -= _reduceValue * Time.deltaTime;
             _line.rectTransform.sizeDelta = _lineSize;
             #region AUTOMODE
             if (PlayMusicInfo.ReturnAutoMode())
             {
                 if (_line.rectTransform.sizeDelta.x < _circle.rectTransform.sizeDelta.x) // 노트를 놓치는 판정 범위
                 {
                     _line.color = Color.clear;
                     Hit("AWESOME");
                 }
             }
             else
             {
                 if (_line.rectTransform.sizeDelta.x < _circle.rectTransform.sizeDelta.x - _missRange) // 노트를 놓치는 판정 범위
                 {
                     Hit("MISS");
                 }
             }
             #endregion
         }
         else
         {
             _touchTime += Time.deltaTime;
             if (_touchTime > _slashTime)
             {
                 Hit("FAIL");
             }
         }
     }
 }
Exemplo n.º 13
0
 public void ChangeValue()
 {
     Time.timeScale = _pitchValue.value;
     PlayMusicInfo.SetPitch(_pitchValue.value);
     SoundManager.instance.SetPitchValue(_pitchValue.value);
 }
Exemplo n.º 14
0
 private void Start()
 {
     _pitchValue.value = PlayMusicInfo.ReturnPitch();
 }
Exemplo n.º 15
0
 public void ReadNoteFile()
 {
     value = FileManager.ReadTextOneLine(PlayMusicInfo.ReturnSongName() + ".txt", "Notes/").Split('/');
     MakeObjectPool();
 }
Exemplo n.º 16
0
 public void SetAutoMode()
 {
     PlayMusicInfo.SetAutoMode(_toggle.isOn);
     _offImage.enabled = !_toggle.isOn;
 }