本文整理汇总了C#中UnityEditor.SerializedProperty.ClearArray方法的典型用法代码示例。如果您正苦于以下问题:C# SerializedProperty.ClearArray方法的具体用法?C# SerializedProperty.ClearArray怎么用?C# SerializedProperty.ClearArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEditor.SerializedProperty
的用法示例。
在下文中一共展示了SerializedProperty.ClearArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateTransformMask
public static void UpdateTransformMask(SerializedProperty transformMask, string[] refTransformsPath, string[] humanTransforms)
{
// ISSUE: object of a compiler-generated type is created
// ISSUE: variable of a compiler-generated type
AvatarMaskUtility.\u003CUpdateTransformMask\u003Ec__AnonStorey89 maskCAnonStorey89 = new AvatarMaskUtility.\u003CUpdateTransformMask\u003Ec__AnonStorey89();
// ISSUE: reference to a compiler-generated field
maskCAnonStorey89.refTransformsPath = refTransformsPath;
transformMask.ClearArray();
// ISSUE: object of a compiler-generated type is created
// ISSUE: variable of a compiler-generated type
AvatarMaskUtility.\u003CUpdateTransformMask\u003Ec__AnonStorey8A maskCAnonStorey8A = new AvatarMaskUtility.\u003CUpdateTransformMask\u003Ec__AnonStorey8A();
// ISSUE: reference to a compiler-generated field
maskCAnonStorey8A.\u003C\u003Ef__ref\u0024137 = maskCAnonStorey89;
// ISSUE: reference to a compiler-generated field
// ISSUE: reference to a compiler-generated field
// ISSUE: reference to a compiler-generated field
// ISSUE: reference to a compiler-generated field
// ISSUE: reference to a compiler-generated field
for (maskCAnonStorey8A.i = 0; maskCAnonStorey8A.i < maskCAnonStorey89.refTransformsPath.Length; maskCAnonStorey8A.i = maskCAnonStorey8A.i + 1)
{
// ISSUE: reference to a compiler-generated field
transformMask.InsertArrayElementAtIndex(maskCAnonStorey8A.i);
// ISSUE: reference to a compiler-generated field
// ISSUE: reference to a compiler-generated field
// ISSUE: reference to a compiler-generated field
transformMask.GetArrayElementAtIndex(maskCAnonStorey8A.i).FindPropertyRelative("m_Path").stringValue = maskCAnonStorey89.refTransformsPath[maskCAnonStorey8A.i];
// ISSUE: reference to a compiler-generated method
bool flag = humanTransforms == null || ArrayUtility.FindIndex<string>(humanTransforms, new Predicate<string>(maskCAnonStorey8A.\u003C\u003Em__14A)) != -1;
// ISSUE: reference to a compiler-generated field
transformMask.GetArrayElementAtIndex(maskCAnonStorey8A.i).FindPropertyRelative("m_Weight").floatValue = !flag ? 0.0f : 1f;
}
}
示例2: LoadQuests
private void LoadQuests()
{
// Reset properties
actProperty = serializedObject.FindProperty("act");
sceneProperty = serializedObject.FindProperty("scene");
questListProperty = serializedObject.FindProperty("questList");
TextAsset[] questsList=ParleyMenu.GetActSceneQuests(ParleyMenu.GetActs()[actProperty.intValue],ParleyMenu.GetActsScenes()[ParleyMenu.GetActs()[actProperty.intValue]][sceneProperty.intValue]).ToArray();
questListProperty.ClearArray();
for (int x=0;x<questsList.Length;x++){
questListProperty.InsertArrayElementAtIndex(x);
questListProperty.GetArrayElementAtIndex(x).objectReferenceValue=questsList[x];
}
}
示例3: EncryptAndSetBytes
private void EncryptAndSetBytes(string val, SerializedProperty prop, string key)
{
string encrypted = ObscuredString.EncryptDecrypt(val, key);
byte[] encryptedBytes = GetBytes(encrypted);
prop.ClearArray();
prop.arraySize = encryptedBytes.Length;
for (int i = 0; i < encryptedBytes.Length; i++)
{
prop.GetArrayElementAtIndex(i).intValue = encryptedBytes[i];
}
}
示例4: ApplyOutlineChanges
private static void ApplyOutlineChanges(SerializedProperty outlineSP, SpriteRect spriteRect)
{
outlineSP.ClearArray();
for (int index1 = 0; index1 < spriteRect.m_Outline.Count; ++index1)
{
outlineSP.InsertArrayElementAtIndex(index1);
SerializedProperty arrayElementAtIndex = outlineSP.GetArrayElementAtIndex(index1);
arrayElementAtIndex.ClearArray();
List<Vector2> vector2List = spriteRect.m_Outline[index1];
for (int index2 = 0; index2 < vector2List.Count; ++index2)
{
arrayElementAtIndex.InsertArrayElementAtIndex(index2);
arrayElementAtIndex.GetArrayElementAtIndex(index2).vector2Value = vector2List[index2];
}
}
}
示例5: CopyArrayToSerialized
static void CopyArrayToSerialized( SerializedProperty dest, GameObject[] sources )
{
if( dest.arraySize != sources.Length )
{
dest.ClearArray();
for( int i = 0; i < sources.Length; ++i )
{
dest.InsertArrayElementAtIndex( i );
}
}
for( int i = 0; i < sources.Length; ++i )
{
if( dest.GetArrayElementAtIndex( i ).objectReferenceValue != sources[i] )
dest.GetArrayElementAtIndex( i ).objectReferenceValue = sources[i];
}
}