/// <summary>
 /// セルの内容を更新します
 /// </summary>
 /// <param name="itemData"></param>
 public override void UpdateContent(Example02CellDto itemData)
 {
     message.text = itemData.Message;
     if (image.sprite == null || id != itemData.Id)
     {
         image.sprite = GameParameter.Instance().GetMusicData(itemData.Id).GetImage();
     }
     id = itemData.Id;
     if (context != null)
     {
         var isSelected = context.SelectedIndex == DataIndex;
         image.color = new Color32(255, 255, 255, 255);
         if (currentPosition > 0.45f && currentPosition < 0.55f)
         {
             this.transform.SetSiblingIndex(1);
             GameParameter gameParameter = GameParameter.Instance();
             gameParameter.selectMusicDataId = this.id;
             image.color = new Color32(255, 255, 255, 255);
         }
         else
         {
             this.transform.SetSiblingIndex(0);
             image.color = new Color32(255, 255, 255, 150);
         }
     }
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        SimpleMusicData musicData = GameParameter.Instance().GetSelectMusicData();

        max_count  = (musicData.KeyArray == null) ? 0 : musicData.KeyArray.Length;
        scoreBoard = GameObject.Find("ScoreBoard");
        scoreText  = scoreBoard.GetComponent <Text>();
    }
Example #3
0
    // Update is called once per frame
    void Update()
    {
        GameParameter gameParameter = GameParameter.Instance();

        Text text = title.GetComponent <Text>();

        text.text = gameParameter.GetSelectMusicData().Inf.title;
        text      = describe.GetComponent <Text>();
        text.text = gameParameter.GetSelectMusicData().GetDescribe();
    }
        void OnPressedCell()
        {
            GameParameter gameParameter = GameParameter.Instance();

            gameParameter.selectMusicDataId = this.id;

            SceneManager.LoadScene("Game");
            if (context != null)
            {
                context.OnPressedCell(this);
            }
        }
Example #5
0
    void Start()
    {
        // 楽曲データを読み込む
        GameParameter   gameParameter = GameParameter.Instance();
        SimpleMusicData musicData     = gameParameter.GetSelectMusicData();

        audioManager = AudioManager.Instance;

        // オーディオソースの準備
        audioManager.SetClip(musicData.GetAudioClip());

        // 楽曲を再生(ゲーム開始)する。
        audioManager.Play();
    }
Example #6
0
    private void Update()
    {
        bool readable = true;

        foreach (string key in keys)
        {
            readable &= loadFiles.ContainsKey(key);
        }
        if (readable)
        {
            GameParameter gameParameter = GameParameter.Instance();
            gameParameter.SetLocalResources(this);
        }
    }
Example #7
0
        void Start()
        {
            List <Example02CellDto> cellDataList  = new List <Example02CellDto>();
            GameParameter           gameParameter = GameParameter.Instance();
            List <SimpleMusicData>  musicDatas    = gameParameter.musicDatas;

            foreach (var item in musicDatas)
            {
                var cellData = new Example02CellDto();
                cellData.Message = item.Inf.title;
                cellData.Id      = item.Id;
                cellDataList.Add(cellData);
            }
            scrollView.UpdateData(cellDataList);
        }
Example #8
0
    void InitNotes()
    {
        musicData = GameParameter.Instance().GetSelectMusicData();

        // ノート情報
        timingArray = musicData.TimingArray;
        keyArray    = musicData.KeyArray;
        noteIndex   = 0;
        poolIndex   = 0;

        float fallDist  = Constants.DEFAULT_FALL_DIST;
        float fallSpeed = (3 / Constants.DEFAULT_FALL_SPEED) * (120.0f / musicData.Bpm);

        fallTime = fallSpeed / fallDist * 100;
        Debug.Log("fallDist : " + fallDist);
        Debug.Log("fallSpeed : " + fallSpeed);
        Debug.Log("falltime : " + fallTime);
        float fallDistOffset = 0;

        if (!Mathf.Approximately(Constants.JUDGE_OFFSET_TIME, 0.0f))
        {
            fallDistOffset = (float)(fallDist / fallTime * Constants.JUDGE_OFFSET_TIME);
        }
        else
        {
            fallDistOffset = 0;
        }

        //ノートプールの準備
        notePool       = new List <Note>();
        activeNoteList = new List <Note>();

        // TODO:fallSpeedはBPMによって変化させる
        for (var i = 0; i < poolSize; i++)
        {
            GameObject noteObject = Instantiate(notePrefab, new Vector3(0, -100, -100), new Quaternion(0.0f, 180.0f, 0.0f, 1.0f));
            Note       note       = noteObject.GetComponent <Note>();
            note.InitNote();
            note.fallDist       = fallDist;
            note.fallDistOffset = fallDistOffset;
            note.fallSpeed      = fallSpeed;
            note.fallTime       = fallTime;
            notePool.Add(note);
        }
    }