Пример #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            serializedObject.Update();

            NSTMaster.EnsureExistsInScene("NST Master").EnsureHasCorrectAdapter();

            var nstsettings = (NSTSettings)target;

            nstsettings.MaxNSTObjects = (uint)System.Math.Pow(2, nstsettings.bitsForNstId);
            nstsettings.frameCount    = (int)System.Math.Pow(2, nstsettings.bitsForPacketCount);

            float adjustedFixedTime = Time.fixedDeltaTime;

            EditorGUILayout.Space();
            EditorGUILayout.LabelField(new GUIContent("Summary:"), "BoldLabel");

            string str =
                "Physics Rate: " + adjustedFixedTime.ToString("0.000") + "ms (" + (1 / adjustedFixedTime).ToString("0.0") + " ticks/sec)\n\n" +

                "You can change the physics rate by changing the Edit/Project Settings/Time/Fixed Step value. \n\n" +

                NSTMapBoundsEditor.WorldBoundsSummary()
            ;

            EditorGUILayout.HelpBox(str, MessageType.None);

            serializedObject.ApplyModifiedProperties();
        }
Пример #2
0
        public override bool DrawGui(object target, bool asFoldout, bool includeScriptField)
        {
            bool isExpanded = base.DrawGui(target, asFoldout, includeScriptField);

            if (isExpanded)
            {
                EditorGUILayout.HelpBox(NSTMapBoundsEditor.WorldBoundsSummary(), MessageType.None);
            }

            return(isExpanded);
        }