/// <summary>
        /// Restore default values.
        /// </summary>
        public void SetDefaults()
        {
            this.isActive = true;

            this.snapThreshold         = 0.01f;
            this.keepSeparate          = KeepSeparateColliderFlag.ByTag | KeepSeparateColliderFlag.ByLayer;
            this.includeSolidTiles     = false;
            this.solidTileColliderType = ColliderType.BoxCollider3D;
        }
        /// <summary>
        /// Set option values from another options instance.
        /// </summary>
        /// <param name="options">Options.</param>
        public void SetFrom(ReduceColliderOptions options)
        {
            this.isActive = options.isActive;

            this.snapThreshold         = options.snapThreshold;
            this.keepSeparate          = options.keepSeparate;
            this.includeSolidTiles     = options.includeSolidTiles;
            this.solidTileColliderType = options.solidTileColliderType;
        }
Exemplo n.º 3
0
        private static void DrawKeepSeparateField(Rect position, SerializedProperty property, GUIContent label)
        {
            bool initialShowMixedValue = EditorGUI.showMixedValue;

            EditorGUI.BeginProperty(position, label, property);

            EditorGUI.showMixedValue = property.hasMultipleDifferentValues;
            EditorGUI.BeginChangeCheck();
            KeepSeparateColliderFlag keepSeparateFlags = (KeepSeparateColliderFlag)EditorGUI.EnumMaskField(position, label, (KeepSeparateColliderFlag)property.intValue);

            EditorGUI.showMixedValue = initialShowMixedValue;
            if (EditorGUI.EndChangeCheck())
            {
                property.intValue = (int)keepSeparateFlags & 0x03;
            }

            EditorGUI.EndProperty();
        }