OnGUI() 공개 메소드

public OnGUI ( NFIKernelModule kernel, int nHeight, int nWidth ) : void
kernel NFrame.NFIKernelModule
nHeight int
nWidth int
리턴 void
예제 #1
0
 public void OnGUI(int nHeight, int nWidth)
 {
     if (null != mxObjectElement)
     {
         mxObjectElement.OnGUI(NFCKernelModule.Instance, nHeight, nWidth);
     }
     OnOpratorGUI(nHeight, nWidth);
 }
예제 #2
0
 void OnGUI()
 {
     if (bCommand)
     {
         mxObjectElement.OnGUI(NFCKernelModule.Instance, 640, 960);
         mxObjectGM.GUICall(800, 600);
     }
 }
예제 #3
0
    private void OnGUI()
    {
        if (mbShowServer)
        {
            ArrayList arrayList = mConfig.GetServerList();
            scrollPosition = GUI.BeginScrollView(new Rect(Screen.width / 2 - 200, 0, 400, 600), scrollPosition, new Rect(0, 0, 400, arrayList.Count * 100));

            //all object
            for (int i = 0; i < arrayList.Count; i++)
            {
                NFConfig.Server server = (NFConfig.Server)arrayList[i];

                if (GUI.Button(new Rect(0, i * 100, 400, 100), server.strName + " " + server.strIP))
                {
                    mbShowServer = false;
                    mNetModule.StartConnect(server.strIP, port);
                }
            }

            if (strIP.Length == 0)
            {
                strIP = PlayerPrefs.GetString("IP");
            }

            strIP = GUI.TextField(new Rect(0, arrayList.Count * 100, 300, 100), strIP);
            if (GUI.Button(new Rect(300, arrayList.Count * 100, 100, 100), "connect"))
            {
                if (strIP.Length > 0)
                {
                    mbShowServer = false;
                    mNetModule.StartConnect(strIP, port);

                    PlayerPrefs.SetString("IP", strIP);
                }
            }

            GUI.EndScrollView();
        }
        else
        {
            if (mNetModule.GetState() == NFNetState.Disconnected)
            {
                mbShowServer = true;
            }
        }

        if (!mbShowCMDGUI)
        {
            return;
        }
        //if (Application.platform == RuntimePlatform.OSXEditor
        //    || Application.platform == RuntimePlatform.OSXPlayer)
        {
            mLogModule.PrintGUILog();

            GUI.Label(new Rect(0, 0, 200, 20), "Speed:" + sliderValue.ToString());
            sliderValue = GUI.HorizontalSlider(new Rect(80, 0, Screen.width - 80 * 2, 20), sliderValue, 0.0f, 1.0f);
            if (!bStopTime)
            {
                Time.timeScale = sliderValue;
            }
            if (GUI.Button(new Rect(Screen.width - 80, 0, 40, 20), "暂停"))
            {
                if (bStopTime)
                {
                    Time.timeScale = sliderValue;
                    bStopTime      = false;
                }
                else
                {
                    Time.timeScale = 0.0f;
                    bStopTime      = true;
                }
            }
            if (mbShowCMDGUI)
            {
                if (GUI.Button(new Rect(0, 0, 40, 20), "ROLE"))
                {
                    mbShowElement = !mbShowElement;
                }
            }
        }

        if (mbShowElement)
        {
            mxObjectElement.OnGUI(mKernelModule, 750, 1334);
        }
    }