static void SwitchTask () { if (level > 1) GameObject.Find ("task (" + (level - 1) + ")").GetComponent<Text> ().GetComponent<GUIEffects> ().DismissNow (); GameObject.Find ("task (" + (level) + ")").GetComponent<Text> ().enabled = true; GUIEffects guiEffect = GameObject.Find ("task (" + (level) + ")").GetComponent<Text> ().GetComponent<GUIEffects> (); guiEffect.ApplyRandomEffects (); }
// when enabled void OnEnable() { effectScript = ( GUIEffects )target; }
// when enabled void OnEnable() { effectScript = ( GUIEffects )target ; }