Chris Gregan
9 years ago
5 changed files with 69 additions and 75 deletions
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 895ead76bb3488c4481a5ae7d88c03df |
||||
folderAsset: yes |
||||
timeCreated: 1462775995 |
||||
licenseType: Pro |
||||
DefaultImporter: |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,45 @@
|
||||
using UnityEditor; |
||||
using UnityEngine; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
public static class SerializedPropertyExtensions |
||||
{ |
||||
public static void ResetValue(this SerializedProperty element) { |
||||
switch (element.type) { |
||||
case "string": |
||||
element.stringValue = ""; |
||||
break; |
||||
case "Vector2f": |
||||
element.vector2Value = Vector2.zero; |
||||
break; |
||||
case "Vector3f": |
||||
element.vector3Value = Vector3.zero; |
||||
break; |
||||
case "Rectf": |
||||
element.rectValue = new Rect(); |
||||
break; |
||||
case "Quaternionf": |
||||
element.quaternionValue = Quaternion.identity; |
||||
break; |
||||
case "int": |
||||
element.intValue = 0; |
||||
break; |
||||
case "float": |
||||
element.floatValue = 0f; |
||||
break; |
||||
case "UInt8": |
||||
element.boolValue = false; |
||||
break; |
||||
case "ColorRGBA": |
||||
element.colorValue = Color.black; |
||||
break; |
||||
|
||||
default: |
||||
if (element.type.StartsWith("PPtr")) |
||||
element.objectReferenceValue = null; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2 |
||||
guid: ffbc18a30fa1a6547a0ef5fc3389c9c0 |
||||
timeCreated: 1462775995 |
||||
licenseType: Pro |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Loading…
Reference in new issue