public void OnDeleteArea(GameObject go)
    {
        var entry = go.GetComponent <MultipleChoiceAreaEntry>();

        toggleGroup.UnregisterToggle(entry.toggle);
        File.Delete(entry.miniatureUrl);
        answerAreas.Remove(entry.area);
        toggleGroup.UnregisterToggle(go.GetComponentInChildren <Toggle>());
        Destroy(go);

        var toggles = toggleGroup.GetAllToggles();

        for (int i = 0; i < toggles.Count; i++)
        {
            if (toggles[i].isOn)
            {
                answerCorrect = i;
            }
        }
    }
示例#2
0
    public void DeleteAlbumEntry(GameObject go)
    {
        var entry = go.GetComponent <MultipleChoiceImageEntry>();

        entries.Remove(entry);
        toggleGroup.UnregisterToggle(go.GetComponentInChildren <Toggle>());
        Destroy(go);

        var toggles = toggleGroup.GetAllToggles();

        for (int i = 0; i < toggles.Count; i++)
        {
            if (toggles[i].isOn)
            {
                answerCorrect = i;
            }
        }
    }