public void ThemeIn() { GetComponent <Animator>().Play("ThemeIn"); if (infos.GetComponentInChildren <ScrollRect>() != null) { infos.GetComponent <Animator>().Play("ThemeOut"); } }
void Start() { infoPopUp.GetComponent <Canvas>().worldCamera = Camera.main; infoPopUp.SetFadeDuration(0.5f); quiz.GetComponent <Canvas>().worldCamera = Camera.main; background.SetActive(false); }
public void CreatePopup(string Text, Color Color, Vector3 Position) { InfoPopup NewPopoup = GameObject.Instantiate <InfoPopup>(PopupPrototype, transform); NewPopoup.transform.parent = transform; NewPopoup.SetText(Text, Color); RectTransform RTransf = NewPopoup.GetComponent <RectTransform>(); print(MainCamera.WorldToScreenPoint(Position)); RTransf.position = MainCamera.WorldToScreenPoint(Position); }