Example #1
0
 private void Start()
 {
     voiceActingEvent = FMODUnity.RuntimeManager.CreateInstance(voiceActingEventString);
     voiceActingEvent.start();
     //if(Input.GetKeyDown(KeyCode.S))
     //{
     captain.ChangeName("captain_0");
     captain.StartPlayback();
     //}
 }
Example #2
0
    private void Start()
    {
        musicEvent = FMODUnity.RuntimeManager.CreateInstance(musicEventString);
        musicEvent.getParameter("TransitionGameMusic", out musicTransition);
        musicEvent.start();
        Instance      = this;
        dancers       = new List <DancePlayback>();
        directoryInfo = new DirectoryInfo("Assets/Resources/");
        files         = directoryInfo.GetFiles("*.txt").OrderByDescending(p => p.CreationTime).ToArray();

        player = GameObject.Find("Player").GetComponent <PlayerScript>();
        foreach (FileInfo file in files)
        {
            //make a dancer for each file
            if (file.Name != "captain.txt")
            {
                DancePlayback dancerInstance = GameObject.Instantiate <DancePlayback>(dancerPrefab, player.SpawnLogic.SpawnPointsObject.transform.GetChild(dancers.Count).position, Quaternion.identity);
                dancerInstance.ChangeName(file.Name.Replace(".txt", ""));
                dancers.Add(dancerInstance);
            }
        }
        captain.ChangeName("captain");
    }