Exemplo n.º 1
0
    void OnOKBtnClickCallback(int index)
    {
        //Debug.LogError("OnOKBtnClickCallback");
        ClickDispatcher.Inst.EnableClick = true;

        PeopleManager.Instance.Reset();
        ChooseDo.Instance.ResetAll();
        HighLightCtrl.GetInstance().OffAllObjs();
        UIManager.Instance.GetUI <SwapUI>("SwapUI").ResetUI();
        GlobalEntity.GetInstance().RemoveAllListeners(ClickDispatcher.mEvent.DoClick);

        //上一个阶段处理
        Debug.LogFormat((string.Format("  当前阶段:   {0}  ", (ModelTasks)index)));
        ModelTasks mt = FlowModel.GetInstance().CurrFlowTask.FlowEnumID;

        FlowModel.GetInstance().RemovePrefabFromMem(mt.ToString());

        //跳转阶段
        FlowTask ft = FlowModel.GetInstance().CurrFlowTask;

        ft = FlowModel.GetInstance().FindFlowTask((ModelTasks)index);
        FlowModel.GetInstance().CurrFlowTask = ft;

        StringBuilder sb     = new StringBuilder("Prefabs/").Append(ft.FlowEnumID.ToString()).Append("/").Append(ft.FlowEnumID.ToString());
        GameObject    module = ResManager.GetPrefab(sb.ToString());

        FlowModel.GetInstance().PushPrefabToMem(ft.FlowEnumID.ToString(), module);
    }
Exemplo n.º 2
0
    private void Start()
    {
        Text    title    = transform.Find("summary/bg/title/text").GetComponent <Text>();
        Text    content  = transform.Find("summary/bg/content").GetComponent <Text>();
        int     curIndex = (int)FlowModel.GetInstance().CurrFlowTask.FlowEnumID;
        SumText st       = SumaryModel.GetInstance().GetContent(curIndex + 1);

        title.text   = st.title;
        content.text = "\u3000\u3000" + st.content;
    }
Exemplo n.º 3
0
    private void OnFlowStepFinished(ModelTasks mt)
    {
        //Debug.LogError(mt.ToString());s
        FlowModel.GetInstance().RemovePrefabFromMem(mt.ToString());
        FlowModel.GetInstance().NextFlowTask();
        FlowTask      ft     = FlowModel.GetInstance().CurrFlowTask;
        StringBuilder sb     = new StringBuilder("Prefabs/").Append(ft.FlowEnumID.ToString()).Append("/").Append(ft.FlowEnumID.ToString());
        GameObject    module = ResManager.GetPrefab(sb.ToString());

        FlowModel.GetInstance().PushPrefabToMem(ft.FlowEnumID.ToString(), module);
    }
Exemplo n.º 4
0
    private void Start()
    {
        GlobalEntity.GetInstance().AddListener <ModelTasks>(FlowModel.mEvent.FlowStepFinished, OnFlowStepFinished);
        FlowTask      ft = FlowModel.GetInstance().CurrFlowTask;
        StringBuilder sb = new StringBuilder("Prefabs/").Append(ft.FlowEnumID.ToString()).Append("/").Append(ft.FlowEnumID.ToString());
        GameObject    go = ResManager.GetPrefab(sb.ToString());

        FlowModel.GetInstance().PushPrefabToMem(ft.FlowEnumID.ToString(), go);
        //PreInitComm();
        HomePageModel.GetInstance();
        new GameObject("xmlParse").AddComponent <XmlParse>();
    }
Exemplo n.º 5
0
 /// <summary>
 /// 做题回调
 /// </summary>
 void Callback()
 {
     subject++;
     Debug.Log(subject);
     if (subject == 5)
     {
         //弹出总结框
         Summary sum = ResManager.GetPrefab("Prefabs/UI/summary").GetComponent <Summary>();
         sum.transform.SetParent(transform, false);
         int curIndex = (int)FlowModel.GetInstance().CurrFlowTask.FlowEnumID;
         sum.ChangeContent(curIndex);
     }
 }
Exemplo n.º 6
0
    private void OnReDo()
    {
        TestPaperItem[] Items = transform.GetComponentsInChildren <TestPaperItem>();//数据清除
        for (int i = 0; i < Items.Length; i++)
        {
            Items[i].ResetAll();
        }
        int curIndex = (int)FlowModel.GetInstance().CurrFlowTask.FlowEnumID;

        TestPaperModel.GetInstance().paperList[curIndex].ResetData();
        Redo();
        //Debug.LogError("redo");
        //Redo();
    }
Exemplo n.º 7
0
    public void Init()
    {
        int curIndex = (int)FlowModel.GetInstance().CurrFlowTask.FlowEnumID;
        //curIndex = 1;//测试
        //Debug.LogError(indexe)
        Paper paper = TestPaperModel.GetInstance().paperList[curIndex];

        paper.ResetData();
        transform.Find("bg/Image/title").GetComponent <Text>().text = paper.title;
        Transform content = transform.Find("subject/Viewport/Content");

        for (int i = 0; i < paper.itemList.Count; i++)
        {
            TestPaperItem tPaperItem = ResManager.GetPrefab("Prefabs/UI/TestPaperItem").GetComponent <TestPaperItem>();
            tPaperItem.name = i.ToString();
            tPaperItem.transform.SetParent(content);
            tPaperItem.Init(paper.itemList[i]);
        }
    }
Exemplo n.º 8
0
    private void OnNextDo()
    {
        TestPaperItem[] Items = transform.GetComponentsInChildren <TestPaperItem>();//数据清除
        for (int i = 0; i < Items.Length; i++)
        {
            if (Items[i].item_right == Items[i].item_wrong)
            {
                TipUI tipUI = UIManager.Instance.GetUI <TipUI>("TipUI");
                tipUI.SetTipMessage("还有题目为未做 !");
                //UIManager.Instance.SetUIDepthTop("TipUI");
                transform.SetAsLastSibling();
                tipUI.transform.SetAsLastSibling();
                return;
            }
        }
        int right = 0, wrong = 0;

        for (int i = 0; i < Items.Length; i++)
        {
            right += Items[i].item_right;
            wrong += Items[i].item_wrong;
        }

        int   curIndex = (int)FlowModel.GetInstance().CurrFlowTask.FlowEnumID;
        Paper paper    = TestPaperModel.GetInstance().paperList[curIndex];

        paper.rightNum = right;
        paper.wrongNum = wrong;

        //Debug.LogError(curIndex);

        Finished();
        if (evtFinished != null)
        {
            evtFinished();
        }
        Debug.Log(FlowModel.GetInstance().CurrFlowTask.thisFlowStepName + "     正确个数和错误个数统计     " + TestPaperModel.GetInstance().TotalCount());
    }