Пример #1
0
    void Start()
    {
        MaxStepUI  = 0;
        NextStepUI = -1;
        AlgoTypeUI = 1;
        FileTypeUI = 1;
        commonObj.Init();
        commonObj.mMainUI = this;
        curChennel        = transform.FindChild("Panel/ChannelId").GetComponent <InputField>();
        curChennel.text   = "0";
        CppInterface.NewViewHandle();
        util.ReadHistory(out inputBoxHistory, out lastOpenHistory);
        util.ReadSetting(out uiSetting);
        mainPanel = transform.FindChild("Panel");
        updateListUI();
        commonObj.prefabFileBrower = prefabBrowser;
        listUI             = GameObject.Find("Canvas/Panel/ListRoot/ScrollView/List");
        commonObj.listRoot = listUI.transform;
        runBtn             = GameObject.Find("Canvas/Panel/RunBtn").GetComponent <Button>();
        stopBtn            = GameObject.Find("Canvas/Panel/Stop").GetComponent <Button>();
        reloadBtn          = GameObject.Find("Canvas/Panel/Reload").GetComponent <Button>();
        clearLogBtn        = GameObject.Find("Canvas/Panel/ClearLog").GetComponent <Button>();
        debugLogUI         = GameObject.Find("Canvas/DebugLog").GetComponent <Text>();
        //GameObject.Find ("Canvas/DebugLog").SetActive (false);
        showFrameUI = GameObject.Find("Canvas/Panel/HideFrame").GetComponent <Toggle>();
        showLogUI   = GameObject.Find("Canvas/Panel/ShowLog").GetComponent <Toggle>();
        GScaleUI    = GameObject.Find("Canvas/Panel/GScale").GetComponent <InputField>();
        if (uiSetting.ContainsKey("GScale"))
        {
            string gscaleStr = uiSetting ["GScale"];
            onChangeGScale(gscaleStr);
            GScaleUI.text = gscaleStr;
        }

        //debugLogUI.color = new Color (255, 0, 0, 255);
        runBtn.interactable = true;
        curState            = UIState.idle;
        updateCurTime       = 0;
        requestPause        = false;
        commonObj.goundGird = groundGird.create();
        commonObj.goundGird.gameObject.SetActive(true);
        camModel.generateMesh();
    }
Пример #2
0
 public void onRunBtn()
 {
     CppInterface.NewViewHandle();
     if (AlgoTypeUI == 1)
     {
         CppInterface.SetParam(0, Params[0]);
         CppInterface.SetParam(1, Params[1]);
         CppInterface.SetParam(2, Params[2]);
         CppInterface.SetParam(3, Params[3]);
         FileAddrUI = Params [3];
     }
     if (AlgoTypeUI == 2)
     {
     }
     if (AlgoTypeUI == 3)
     {
         CppInterface.SetParam(0, Params[0]);
         CppInterface.SetParam(1, Params[1]);
     }
     oThread = new Thread(RunThread);
     oThread.Start();
 }