Inheritance: MonoBehaviour
Beispiel #1
0
    void OnGUI()
    {
        if (UI.showHelp)
        {
            return;
        }

        SampleUI.ApplyVirtualScreen();

        string        buttonText;
        DragPlaneMode nextDragPlaneMode;

        switch (dragPlaneMode)
        {
        case DragPlaneMode.Plane:
            buttonText        = "Drag On Plane";
            nextDragPlaneMode = DragPlaneMode.Sphere;
            break;

        case DragPlaneMode.Sphere:
            buttonText        = "Drag On Sphere";
            nextDragPlaneMode = DragPlaneMode.XY;
            break;

        default:
            buttonText        = "Drag On XZ";
            nextDragPlaneMode = DragPlaneMode.Plane;
            break;
        }

        if (GUI.Button(dragModeButtonRect, buttonText))
        {
            SetDragPlaneMode(nextDragPlaneMode);
        }
    }
Beispiel #2
0
    void OnGUI()
    {
        SampleUI.ApplyVirtualScreen();

        string    buttonText;
        InputMode nextInputMode;

        switch (inputMode)
        {
        case InputMode.PinchOnly:
            buttonText    = "Pinch Only";
            nextInputMode = InputMode.RotationOnly;
            break;

        case InputMode.RotationOnly:
            buttonText    = "Rotation Only";
            nextInputMode = InputMode.PinchAndRotation;
            break;

        default:
            buttonText    = "Pinch + Rotation";
            nextInputMode = InputMode.PinchOnly;
            break;
        }

        if (GUI.Button(inputModeButtonRect, buttonText))
        {
            inputMode = nextInputMode;
        }
    }
Beispiel #3
0
    void OnGUI()
    {
        SampleUI.ApplyVirtualScreen();

        GUILayout.BeginArea(screenRect);
        GUILayout.BeginHorizontal();

        GUILayout.Space(sideBorder);

        if (CurrentMenuRoot)
        {
            GUILayout.BeginVertical();

            GUILayout.Space(15);
            GUILayout.Label(CurrentMenuRoot.name, titleStyle);

            for (int i = 0; i < CurrentMenuRoot.childCount; ++i)
            {
                Transform item = CurrentMenuRoot.GetChild(i);

                if (GUILayout.Button(item.name, GUILayout.Height(buttonHeight)))
                {
                    MenuNode menuNode = item.GetComponent <MenuNode>();
                    if (menuNode && menuNode.sceneName != null && menuNode.sceneName.Length > 0)
                    {
                        SceneManager.LoadScene(menuNode.sceneName);
                    }
                    //Application.LoadLevel( menuNode.sceneName );
                    else if (item.childCount > 0)
                    {
                        CurrentMenuRoot = item;
                    }
                }

                GUILayout.Space(5);
            }

            GUILayout.FlexibleSpace();

            if (CurrentMenuRoot != itemsTree && CurrentMenuRoot.parent)
            {
                if (GUILayout.Button("<< BACK <<", GUILayout.Height(buttonHeight)))
                {
                    CurrentMenuRoot = CurrentMenuRoot.parent;
                }

                GUILayout.Space(15);
            }

            GUILayout.EndVertical();
        }

        GUILayout.Space(sideBorder);
        GUILayout.EndHorizontal();
        GUILayout.EndArea();
    }
    void CreateItemContainer(int key, GameObject slot, Sample sample)
    {
        //create item container in slot
        GameObject uiSampleObj = Object.Instantiate(uiSample, slot.transform);
        //uiItemObj.name = item.title;

        //set item container values
        SampleUI sampleUIData = uiSampleObj.GetComponent <SampleUI>();

        uiSamples.Add(key, sampleUIData);
        sampleUIData.sample = sample;
    }
Beispiel #5
0
    public static void Main(string[] argv)
    {
        ClientApi client = new ClientApi();
        // ClientUser ui = new ClientUser();
        SampleUI ui = new SampleUI();
        Error error = new Error();

        client.Init(error);
        client.Run("info", ui);

        client.SetArgv(new string[] { "-u", "cmarshall" });
        client.Run("clients", ui);
        client.Final(error);
    }
Beispiel #6
0
 protected virtual void Awake()
 {
     ui = GetComponent<SampleUI>();
 }
Beispiel #7
0
 protected virtual void Awake()
 {
     ui = GetComponent <SampleUI>();
 }