// Use this for initialization void Start() { ScreenManager = transform.parent.GetComponent <ContextualScreenManager>(); fadeTime = ScreenManager.pageFadeTime; ObjectStartColors = new Color[ObjectsToFade.Length]; if (ObjectsToFade.Length > 0) { for (int i = 0; i < ObjectsToFade.Length; i++) { ObjectStartColors[i] = ObjectsToFade[i].material.color; ObjectsToFade[i].enabled = false; } } if (TextToFade.Length > 0) { TextStartColors = new Color[TextToFade.Length]; for (int i = 0; i < TextToFade.Length; i++) { TextStartColors[i] = TextToFade[i].color; TextToFade[i].enabled = false; } } active = false; visible = false; }
// Use this for initialization void Start() { ContextualScreen = GameObject.Find("ContextualScreenGroup").GetComponent <ContextualScreenManager>(); ScanPage = ContextualScreen.ContextualPages[3]; Fred = GameObject.Find("Fred").GetComponent <FredMovementScript>(); //get reference to parent (breakableRockScript) //get local variables of breakable rock's min and max gems //call CreateGems(min, max) //CreateGems(2, 6); }