public void AddMaterial(int currentStage, PortalMaterial material) { // Create new info panel RectTransform portalStageInfo = (Instantiate(Resources.Load("PortalScreen/PortalStageInfo")) as GameObject).GetComponent <RectTransform>(); portalStageInfo.SetParent(transform, false); portalStageInfo.anchoredPosition = new Vector3(0, TopMargin * currentStage); // Update info panel text for new material Text portalStageText = portalStageInfo.Find("StageText").GetComponent <Text>(); portalStageText.text = "Stage " + currentStage + " : " + material.Name; portalStageText.color = material.VisualColor; }
public void AddMaterial(PortalMaterial material) { stageMaterials.Add(material); Portal.AddMaterial(stageMaterials.Count, material); //load a new trial Type RandomTrial = TrialHandler.Instance.RandomTrial; TrialHandler.Instance.LoadEvent(RandomTrial); //Display a new panel with trial information and start count down trialPanel.UpdatePanelDisplay(TrialHandler.CurrentTrial); trialPanel.TogglePanel(); //start trial scene trialPanel.StartTimer(); }