Beispiel #1
0
    // Start is called before the first frame update
    void Awake()
    {
        sm = gameObject.GetComponent <SMParser>();

        bpm       = sm.bpm;
        multiple  = 2;
        chartData = sm.getNoteData();

        //for (int j = 0; j < noteData.Count; j++)
        //{
        //	Instantiate(prefab);
        //	prefab.transform.position = new Vector3(0, j * 8, 0);
        //}


        float width  = prefab.transform.localScale.x;
        float height = prefab.transform.localScale.y;

        float noteWidth = width / 2;

        Debug.Log(width + " " + height + " " + noteWidth + " ");
        startPos = new Vector3(0, height * chartData.Count * multiple, 0);
        notePrefab.transform.position      = new Vector3(0, height * chartData.Count * multiple, 0);
        guideNotePrefab.transform.position = new Vector3(0, height * chartData.Count * multiple, 0);
        for (int i = 0; i < chartData.Count; i++)
        {
            //prefab.transform.position = new Vector3(0, i * 8, 0);
            //Instantiate(prefab);

            if (chartData[i].Count == bit4)
            {
                setNote(bit4, i);
            }
            else if (chartData[i].Count == bit8)
            {
                setNote(bit8, i);
            }
            else if (chartData[i].Count == bit12)
            {
                setNote(bit12, i);
            }
            else if (chartData[i].Count == bit16)
            {
                setNote(bit16, i);
            }



            //for (int j = 0; j < bit4; j++)
            //{
            //	Instantiate(notePrefab);
            //	notePrefab.transform.position = new Vector3(0, ((j - 1) * (noteHeight)) - 1, 0);
            //}
        }

        // Update is called once per frame
    }
Beispiel #2
0
        public static IParseQueue Lex(string s)
        {
            Profiler.BeginSample("F# Parser");
            //var parsed = SMParser.SMParser2(s).Try.ToArray();
            var parsed = SMParser.SMParser2Exec(s).GetOrThrow;

            Profiler.EndSample();
            return(new PUListParseQueue(parsed, parsed[0].Item2, null));
        }
Beispiel #3
0
    // Start is called before the first frame update
    void Start()
    {
        sm     = GameObject.Find("NoteGenerator").GetComponent <SMParser>();
        offset = sm.meta.offset;

        songFilePath = sm.meta.musicPath;

        musicPlayer = GetComponent <AudioSource>();

        mainMusic = GetComponent <AudioClip>();

        musicPlayer.clip = mainMusic;

        musicPlayer.Play();

        StartCoroutine("OffsetCalc");
    }
Beispiel #4
0
        public bool Parse()
        {
            var status = false;
            var ifile  = new FileStream(this.fileName, FileMode.Open, FileAccess.Read);
            var parser = new SMParser(ifile);

            try
            {
                parser.parseFSM(this);
                status = this.builder.Build();
            }
            catch (ParseException pe)
            {
                throw new Exception(PrintSyntaxError(pe), pe);
            }

            if (this.errorManager.Errors.Any())
            {
                throw new Exception(
                          $"There were errors parsing file {this.fileName}:\n{string.Join("\n\t", this.errorManager.Errors)}");
            }

            return(status);
        }