Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        // display
        asg            = Assignment_Edit_Meta_Script.editAsg;
        popUp          = mainContentPanel.transform.Find("Panel_Messages").gameObject;
        entryContainer = panelObject.transform.Find("Panel_Question_Creation");
        dropdownAnswer = entryContainer.Find("Dropdown_Answer").GetComponent <Dropdown>();
        panelObject.transform.Find("Button_Delete").GetComponent <Button>().interactable = false;    // need to change
        popUp.SetActive(false);
        conn = (API_Assignment)transform.GetComponent(typeof(API_Assignment));
        panelObject.gameObject.SetActive(false);

        // button events
        panelObject.transform.Find("Button_NextQ").GetComponent <Button>().onClick.AddListener(ClickNextOrAdd);
        panelObject.transform.Find("Button_PrevQ").GetComponent <Button>().onClick.AddListener(ClickPrevious);
        panelObject.transform.Find("Button_Return").GetComponent <Button>().onClick.AddListener(ClickReturn);
        panelObject.transform.Find("Button_Save").GetComponent <Button>().onClick.AddListener(ClickSave);
        panelObject.transform.Find("Button_Clear").GetComponent <Button>().onClick.AddListener(ClickClear);
        panelObject.transform.Find("Button_Delete").GetComponent <Button>().onClick.AddListener(ClickDelete);
        popUp.transform.Find("Popup_Incomplete").Find("Button_Confirm").GetComponent <Button>().onClick.AddListener(popupQuestionIncompleteAcknowledge);
        popUp.transform.Find("Popup_Info").Find("Button_Confirm").GetComponent <Button>().onClick.AddListener(popupQuestionInfoAcknowledge);
        popUp.transform.Find("Popup_Delete").Find("Button_Cancel").GetComponent <Button>().onClick.AddListener(exitDelete);
        popUp.transform.Find("Popup_Delete").Find("Button_Confirm").GetComponent <Button>().onClick.AddListener(confirmDelete);

        // variables: questions
        fetchQuestions(asg);
        newQuestion      = false;
        current_question = new AssignmentQuestion();
        asgQuestionList  = new List <AssignmentQuestion>();
        cur = 0;
    }
 void Start()
 {
     conn    = (API_Assignment)transform.GetComponent(typeof(API_Assignment));
     editAsg = Assignment_Entry_Script.chosenAsg;
     populateRetries();
     populateFields();
     panelObject.transform.Find("Button_Cancel").GetComponent <Button>().onClick.AddListener(() => clickCancel());
     panelObject.transform.Find("Button_Edit").GetComponent <Button>().onClick.AddListener(() => clickEdit());
     mainContentPanel.transform.Find("Panel_Messages").Find("Popup_Incomplete").Find("Button_Confirm").GetComponent <Button>().onClick.AddListener(() => incompleteAcknowledge());
 }
    IEnumerator Start()
    {
        conn  = (API_Assignment)transform.GetComponent(typeof(API_Assignment));
        popUp = mainContentPanel.transform.Find("Panel_Messages").gameObject;
        popUp.SetActive(false);
        yield return(StartCoroutine(setAssignmentList()));

        tableInitialize();
        popUp.transform.Find("Popup_Delete").Find("Button_Confirm").GetComponent <Button>().onClick.AddListener(confirmDelete);
        popUp.transform.Find("Popup_Delete").Find("Button_Cancel").GetComponent <Button>().onClick.AddListener(exitDelete);
    }
    // Start is called before the first frame update
    void Awake()
    {
        // display
        popUp          = mainContentPanel.transform.Find("Panel_Messages").gameObject;
        entryContainer = panelObject.transform.Find("Panel_Question_Creation");
        dropdownAnswer = entryContainer.Find("Dropdown_Answer").GetComponent <Dropdown>();
        panelObject.transform.Find("Button_Delete").GetComponent <Button>().interactable = false;
        popUp.SetActive(false);

        // variables: questions
        conn             = (API_Assignment)transform.GetComponent(typeof(API_Assignment));
        asgQuestionList  = new List <AssignmentQuestion>();
        current_question = new AssignmentQuestion();
        asgQuestionList.Add(current_question);
        cur = 0;
        populateFields(current_question, false);
    }