void Start() { SongStarted = false; SS = FindObjectOfType <SongSelect>(); song = SS.Selectedsong; hit1 = GameObject.FindGameObjectWithTag("p1"); hit2 = GameObject.FindGameObjectWithTag("p2"); hit3 = GameObject.FindGameObjectWithTag("p3"); SpritePosition = GameObject.FindGameObjectWithTag("Sprite"); rhythmtool = GetComponent <RhythmTool>(); REP = GetComponent <RhythmEventProvider>(); rhythmtool.NewSong(song); rhythmtool.SongLoaded += OnSongLoaded; REP.onSubBeat.AddListener(OnSubBeat); combo = 0; score = 0; LHeld = false; MHeld = false; RHeld = false; TotalFrames = rhythmtool.totalFrames; }
// Use this for initialization void Start() { rhythmTool = GetComponent <RhythmTool>(); audioClip = GetComponent <AudioSource>().clip; rhythmTool.NewSong(audioClip); }
void SetUpRhythmTool() { rhythmTool = GetComponent <RhythmTool>(); //Give it a song. rhythmTool.NewSong(audioClip); //Subscribe to SongLoaded event. rhythmTool.SongLoaded += OnSongLoaded; }
void Start() { rhythmtool = GetComponent <RhythmTool>(); events = GetComponent <RhythmEventProvider>(); wspawn = FindObjectOfType <Weapon>(); rhythmtool.NewSong(Theme); rhythmtool.SongLoaded += OnSongLoaded; events.onSubBeat.AddListener(OnSubBeat); }
void Start() { //s = transform.Find("spawn").GetComponent<spawn> (); backAmount = StartVar.nback; //get nback amount from the global start values print(backAmount); rhythmTool = GetComponent <RhythmTool>(); //get the rhythm tool rhythmTool.NewSong(audioClip); //set song for the rhythm tool to play low = rhythmTool.Low.Frames; nbacktrack = new int[backAmount + 1]; //create nback list missReserve = new int[backAmount - 1]; //create reserve list //GetComponent<reachscaler>().enabled = true; //Instantiate (startball, new Vector3 (((float)0.08), ((float)2.05), ((float)-0.23)), Quaternion.identity); }
/*///////////////// * * OnEndOfSong * * resets game if endofsong signal sent * also sets text of screen to show if the player won or lost * * */ void OnEndOfSong() { //GetComponent<reachscaler>().enabled = false; if (suc <= err || forcestop) //if the player loses, play lose sound, set screen to "YOUR'E FIRED" { GameObject.Find("effects").GetComponent <AudioSource>().clip = GameObject.Find("effects").GetComponent <sounds>().sfx[2]; GameObject.Find("effects").GetComponent <AudioSource>().Play(); GameObject.Find("labels").GetComponent <TextMesh> ().text = "YOU'RE\nFIRED"; } else //if the player wins, play win sound, set screen to "GOOD JOB" { GameObject.Find("effects").GetComponent <AudioSource>().clip = GameObject.Find("effects").GetComponent <sounds>().sfx[3]; GameObject.Find("effects").GetComponent <AudioSource>().Play(); GameObject.Find("labels").GetComponent <TextMesh> ().text = "GOOD\nJOB"; } nbacktrack = new int[backAmount + 1]; //reset nback and reserve lists missReserve = new int[backAmount - 1]; //Instantiate (startball, new Vector3 (((float)0.08), ((float)2.05), ((float)-0.23)), new Quaternion ()); rhythmTool.NewSong(audioClip); //reset rhythm tool song beats = -1; //reset all values steps = 0; lastFrame = 0; suc = 0; mis = 0; err = 0; forcestop = false; foreach (spawn S in beltSpawners) //reactivate spawners { S.active = true; } foreach (pass P in movers) //reactivate movers { P.active = true; } GameButton.start = true; //reset the game button to act as a start button //GetComponent<reachscaler>().enabled = true; }
void Start() { rhythmTool.NewSong(audioClip); low = rhythmTool.low; rhythmTool.SongLoaded += OnSongLoaded; }