Пример #1
0
    void Start()
    {
        string JSONSong = Application.dataPath + "\\Songs\\" + SongName + ".json";

        Song              = SongLoader.LoadSong(JSONSong);
        scoreDisplay      = GameObject.Find("ScoreDisplay").GetComponent <Text>();
        multiplierDisplay = GameObject.Find("MulitplierDisplay").GetComponent <Text>();


        //keep track of existing notes
        spawnedNotes = new List <GameObject>();

        //We will most likely be creating the spawn nodes in code rather than fetching them
        //Even more likely we will store raw positions in Vector3 rather than even needing GameObjects
        Transform spawnLocs = GameObject.Find("NoteSpawnLocs").transform;

        SpawnLocations = new GameObject[]
        {
            spawnLocs.GetChild(0).gameObject,
            spawnLocs.GetChild(1).gameObject,
            spawnLocs.GetChild(2).gameObject
        };

        //initialize spawn
        Debug.Log(Song.SpawnTime_SpawnLoc[0]);
        nextNote = Song.Spawn();
        //add method to event
        //spawnEvent.AddListener(Camera.main.gameObject.GetComponent<DebugText>().UpdateDebugText);
        spawnEvent.AddListener(SpawnNote);

        //hitbar set
        hitBar = GameObject.Find("HitBar");
    }