예제 #1
0
        protected override void OnElementGUI(Rigidbody2DElement element)
        {
            element.world = (World)EditorGUILayout.ObjectField(new GUIContent("World", "The world component with wrap-around behavior to which this rigidbody conforms."), element.world, typeof(World), true);

            GUILayout.Space(EditorGUIUtility.singleLineHeight);

            if (ElementBoundsEditorUtility.OnInspectorGUI(element, ref element.boundsSource, ref element.boundsProvider))
            {
                element.RefreshBounds();
            }

            GUILayout.Space(EditorGUIUtility.singleLineHeight);
        }
예제 #2
0
        protected override void OnElementGUI(SpriteElement element)
        {
            element.viewport = (Viewport)EditorGUILayout.ObjectField(new GUIContent("Viewport", "The viewport component with wrap-around behavior with which this sprite interacts."), element.viewport, typeof(Viewport), true);

            GUILayout.Space(EditorGUIUtility.singleLineHeight);

            if (ElementBoundsEditorUtility.OnInspectorGUI(element, ref element.boundsSource, ref element.boundsProvider))
            {
                element.RefreshBounds();
            }

            GUILayout.Space(EditorGUIUtility.singleLineHeight);
        }
예제 #3
0
        public override void OnInspectorGUI()
        {
            var element = (MeshElement)target;

            Undo.RecordObject(element, "Mesh Element");

            EditorGUI.BeginChangeCheck();

            element.viewport = (Viewport)EditorGUILayout.ObjectField(new GUIContent("Viewport", "The viewport component with wrap-around behavior with which this mesh interacts."), element.viewport, typeof(Viewport), true);

            GUILayout.Space(EditorGUIUtility.singleLineHeight);

            if (ElementBoundsEditorUtility.OnInspectorGUI(element, ref element.boundsSource, ref element.boundsProvider))
            {
                element.RefreshBounds();
            }

            if (EditorGUI.EndChangeCheck())
            {
                EditorUtility.SetDirty(element);
            }
        }