本文整理汇总了C#中UnityEditor.SerializedProperty.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# SerializedProperty.Reset方法的具体用法?C# SerializedProperty.Reset怎么用?C# SerializedProperty.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEditor.SerializedProperty
的用法示例。
在下文中一共展示了SerializedProperty.Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawFunctionBlockUI
//.........这里部分代码省略.........
if(prop.propertyPath == "m_Script"){
continue;
}
if(prop.name == "parentBlock"){
continue;
}
if(prop.type == "Vector3f"){
searchDeep = false;
}
if(prop.type == "Vector3f" && prop.name == "targetDifference" && currentTidyTarget != null){
prop.vector3Value = currentTidyTarget.targetDifference;
currentTidyTarget = null;
}
if(prop.name == "TidyTarget_parentBlock" && currentTidyTarget != null){
prop.objectReferenceValue = currentTidyTarget.TidyTarget_parentBlock;
}
if(prop.type == "TidyTarget"){
EditorGUILayout.BeginHorizontal();
GUILayout.Label(prop.name + ":");
GUILayout.FlexibleSpace();
Color gc = GUI.color;
if(setTidyTarget == true){
GUI.color = Color.green;
}
if(GUILayout.Button("Set")){
setTidyTarget = true;
//tidyTargetName = prop.name;
currentTidyTarget = null;
}
GUI.color = gc;
EditorGUILayout.EndHorizontal();
continue;
}
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PropertyField(prop);
EditorGUILayout.EndHorizontal();
}while(prop.NextVisible(searchDeep));
prop.Reset();
functionSObj.ApplyModifiedProperties();
functionSObj.Update();
}
else{
GUILayout.Label("Data null.");
}
}catch(Exception e){Debug.LogWarning(e.ToString());}
GUILayout.EndScrollView();
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if(GUILayout.Button("Delete")){
TidyFunctionalObject o = functionBlock.blockMap.functionalOverlay.RemoveDataAt(functionBlock.x,functionBlock.y,functionBlock.depth);
GameObject.DestroyImmediate(o);
functionData = null;
prop = null;
SetEntireMapDirty(functionBlock.blockMap);
functionBlock = null;
}
GUILayout.EndHorizontal();
}
GUILayout.EndVertical();
GUILayout.EndArea();
Handles.EndGUI();
}
示例2: ArrayGUI
void ArrayGUI (SerializedProperty sp, string name)
{
EditorGUIUtility.LookLikeControls (100.0f, 40.0f);
GUILayout.Space (4.0f);
EditorGUILayout.BeginVertical ("box", GUILayout.MaxWidth(Screen.width));
int i = 0;
int del = -1;
SerializedProperty array = sp.Copy ();
SerializedProperty size = null;
bool first = true;
while (true) {
if (sp.propertyPath != name && !sp.propertyPath.StartsWith (name + "."))
break;
bool child;
EditorGUI.indentLevel = sp.depth;
if (sp.depth == 1 && !first) {
EditorGUILayout.BeginHorizontal ();
if (GUILayout.Button ("", "OL Minus", GUILayout.Width (24.0f)))
del = i;
//GUILayout.Label ("" + i);
child = EditorGUILayout.PropertyField (sp);
GUI.enabled = i > 0;
if (GUILayout.Button (manager.arrowUp, "ButtonLeft", GUILayout.Width (22.0f), GUILayout.Height(18.0f)))
array.MoveArrayElement (i - 1, i);
GUI.enabled = i < array.arraySize - 1;
if (GUILayout.Button(manager.arrowDown, "ButtonRight", GUILayout.Width(22.0f), GUILayout.Height(18.0f)))
array.MoveArrayElement (i + 1, i);
++i;
GUI.enabled = true;
EditorGUILayout.EndHorizontal ();
} else if (sp.depth == 1) {
first = false;
size = sp.Copy ();
EditorGUILayout.BeginHorizontal ();
if (!size.hasMultipleDifferentValues && GUILayout.Button("", "OL Plus", GUILayout.Width(24.0f)))
array.arraySize += 1;
child = EditorGUILayout.PropertyField (sp);
EditorGUILayout.EndHorizontal ();
} else {
child = EditorGUILayout.PropertyField(sp);
}
if (!sp.NextVisible (child))
break;
}
sp.Reset ();
if (del != -1)
array.DeleteArrayElementAtIndex (del);
if (array.isExpanded && !size.hasMultipleDifferentValues) {
EditorGUILayout.BeginHorizontal ();
if (GUILayout.Button("", "OL Plus", GUILayout.Width(24.0f)))
array.arraySize += 1;
GUI.enabled = false;
EditorGUILayout.PropertyField (array.GetArrayElementAtIndex (array.arraySize - 1), new GUIContent ("" + array.arraySize));
GUI.enabled = true;
EditorGUILayout.EndHorizontal ();
}
EditorGUI.indentLevel = 0;
EditorGUILayout.EndVertical ();
EditorGUIUtility.LookLikeControls (170.0f, 80.0f);
}