Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (isSongLoad && mode == NE_MODE)
        {
            UpdateSlider();
        }

        if (isSheetLoad)
        {
            SpawnAllNote();
        }

        //detect what we hit
        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        if (Physics.Raycast(ray, out hit))
        {
            if (hit.collider.gameObject.tag == "Note")
            {
                if (currentSelect != null)
                {
                    currentSelect.isSelect = false;
                }
                currentSelect = hit.collider.gameObject.GetComponent <SpawnNote>();
                hit.collider.gameObject.GetComponent <SpawnNote>().isSelect = true;
            }
        }

        //detect to spawn note
        if (Input.GetButtonDown(GlobalInfo.B_SPAWN))
        {
            note.Add(SpawnNote(spawnNotePrefab, GlobalInfo.EnotePos.M, GlobalInfo.EnoteType.instant, music.time, noteColor[(int)GlobalInfo.EnotePos.M], music.time));
            note[note.Count - 1].name = "note" + (note.Count).ToString();
            note[note.Count - 1].GetComponent <SpawnNote>().index = note.Count;
            noteDur = music.time;
        }
        //if (Input.GetButtonUp(GlobalInfo.B_SPAWN)) {
        //    if (music.time - noteDur > GlobalInfo.NOTE_TIME_OFFSET*2) {
        //        note[note.Count - 1].GetComponent<SpawnNote>().enoteType = GlobalInfo.EnoteType.continuousStart;
        //        note.Add(SpawnNote(spawnNotePrefab,GlobalInfo))
        //    }

        //}

        //detect to delete note ref from note list
        if (GlobalInfo.G_isNoteDelete && GlobalInfo.G_deleteNoteIndex != 0)
        {
            note.RemoveAt(GlobalInfo.G_deleteNoteIndex - 1);
            GlobalInfo.G_deleteNoteIndex = 0;
        }
    }
Exemple #2
0
 private void Start()
 {
     _instance = this;
 }