// Use this for initialization void Start() { //If you are not the graph receiver, then you //are an instrument (AAJ) if(GetComponent<GraphReceiver>() == null){ //Sets this instance of ApplyEdit as an instrument (AAJ) isInstrument = true; }//if //Finds the tracing manager (AAJ) tracingManager = GameObject.FindGameObjectWithTag("Trace"); //Gets the components of the tracing screen (AAJ) tracingScript = tracingManager.GetComponent<TracingScript>(); tracingScreen = tracingScript.tracingScreen; tracingGraph = tracingScript.tracingGraph; //Finds the master instrument (AAJ) masterInstrument = GameObject.FindGameObjectWithTag("Master").GetComponent<MasterInstrument>(); }
// Use this for initialization void Start() { yLocation = this.transform.position.y + scrollHeight; downYLocation = yLocation - scrollHeight; //Inititalizes previous position with the start postition (AAJ) previousPosition = transform.position.y; CreateBGGraph(); mainCamera = Camera.main; audioSources = this.GetComponents<AudioSource> (); audioSources[0].clip = Instrument; audioSources[1].clip = Instrument; GameObject temp = GameObject.FindGameObjectWithTag ("SoundLibrary"); if (temp != null) { soundLibrary = temp.GetComponent<SoundLibrary> (); }//if GameObject temp2 = GameObject.FindGameObjectWithTag("Trace"); if (temp2 != null) { tracingScript = temp2.GetComponent<TracingScript> (); if(tracingScript == null){ Debug.LogError("tracing script is null"); } }//if else { Debug.Log ("Nothing Found"); }//else /* GameObject DrawObject = GameObject.FindGameObjectWithTag("Draw"); if (DrawObject != null) { drawLine = DrawObject.GetComponent<DrawLine> (); }//if else { Debug.Log ("Did not find object tagged Draw"); }//else */ LoadDataForInstrument(tracingScript.GetSprite(),tracingScript.GetLinePoints(),tracingScript.GetFileName()); graphSuspended.GetComponent<DrawLine> ().UpdateLine (RawData); Vector3 setter = new Vector3 (-25, -25, 0); //Debug.Log ("here"); visibleNote = Instantiate (MusicNote, setter, this.transform.rotation) as GameObject; playButtonImage.color = invisible; pauseButtonImage.color = visible; loopButtonImage.color = invisible; }