//reference to a object/script with all images and answers // Use this for initialization void Start() { audioPlayer = GetComponent <AudioSource>(); Q1.onClick.AddListener(OnClickAction1); Q2.onClick.AddListener(OnClickAction2); Q3.onClick.AddListener(OnClickAction3); Q4.onClick.AddListener(OnClickAction4); candyButton.onClick.AddListener(OnClickCandy); askButton.onClick.AddListener(MakeQuestionsAppear); GameObject g = GameObject.FindGameObjectWithTag("Scroll"); proto = GetComponentInParent <ProtoTypeManager>(); scrollAct = g.GetComponent <ScrollUp>(); if (_isGod) { //set characterAmount to god characters } else { //set characterAmount to childcharacters } rnd = Random.Range(0, characterAmount); //get character img // Characterimg = characterarray [rnd] //get answer list //characterAnswers = characterAnswers Array [rnd] GetComponentInChildren <SpriteRenderer>().sprite = Characterimg; }
// Start is called before the first frame update void Start() { m_ProtoTypeManager = GetComponent <ProtoTypeManager>(); A a1b1 = new A(); a1b1.name = "A1"; a1b1.b = new B(); a1b1.b.name = "B1"; A a2b1 = new A(); a2b1.name = "A2"; a2b1.b = new B(); a2b1.b.name = "B1"; m_ProtoTypeManager.RegisteProtoType("a1b1", a1b1); m_ProtoTypeManager.RegisteProtoType("a2b1", a2b1); }