Exemple #1
0
        private void DrawSampleDetails(SampleDescriptor sample)
        {
            Rect area = new Rect(Screen.width / 3, statisticsHeight + 5, (Screen.width / 3) * 2, Screen.height - statisticsHeight - 5);

            GUI.Box(area, string.Empty);

            GUILayout.BeginArea(area);
            GUILayout.BeginVertical();
            GUIHelper.DrawCenteredText(sample.DisplayName);
            GUILayout.Space(5);
            GUILayout.Label(sample.Description);
            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Start Sample"))
            {
                sample.CreateUnityObject();
            }

            GUILayout.EndVertical();
            GUILayout.EndArea();
        }
Exemple #2
0
        void Update()
        {
            GUIHelper.ClientArea = new Rect(0, SampleSelector.statisticsHeight + 5, Screen.width, Screen.height - SampleSelector.statisticsHeight - 50);

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                if (SelectedSample != null && SelectedSample.IsRunning)
                {
                    SelectedSample.DestroyUnityObject();
                }
                else
                {
                    Application.Quit();
                }
            }

            if (Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Return))
            {
                if (SelectedSample != null && !SelectedSample.IsRunning)
                {
                    SelectedSample.CreateUnityObject();
                }
            }
        }