本文整理汇总了C#中UnityEditor.SerializedObject.SetIsDifferentCacheDirty方法的典型用法代码示例。如果您正苦于以下问题:C# SerializedObject.SetIsDifferentCacheDirty方法的具体用法?C# SerializedObject.SetIsDifferentCacheDirty怎么用?C# SerializedObject.SetIsDifferentCacheDirty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEditor.SerializedObject
的用法示例。
在下文中一共展示了SerializedObject.SetIsDifferentCacheDirty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoImportBitmapFont
public static void DoImportBitmapFont(string fntPatn)
{
if (!IsFnt(fntPatn)) return;
TextAsset fnt = AssetDatabase.LoadMainAssetAtPath(fntPatn) as TextAsset;
string text = fnt.text;
FntParse parse = FntParse.GetFntParse(ref text);
if (parse == null) return;
string fntName = Path.GetFileNameWithoutExtension(fntPatn);
string rootPath = Path.GetDirectoryName(fntPatn);
string fontPath = string.Format("{0}/{1}.fontsettings", rootPath, fntName);
string texPath = string.Format("{0}/{1}", rootPath, parse.textureName);
Font font = AssetDatabase.LoadMainAssetAtPath(fontPath) as Font;
if (font == null)
{
font = new Font();
AssetDatabase.CreateAsset(font, fontPath);
font.material = new Material(Shader.Find("UI/Default"));
font.material.name = "Font Material";
AssetDatabase.AddObjectToAsset(font.material, font);
}
SerializedObject so = new SerializedObject(font);
so.Update();
so.FindProperty("m_FontSize").floatValue = parse.fontSize;
so.FindProperty("m_LineSpacing").floatValue = parse.lineHeight;
UpdateKernings(so, parse.kernings);
so.ApplyModifiedProperties();
so.SetIsDifferentCacheDirty();
Texture2D texture = AssetDatabase.LoadMainAssetAtPath(texPath) as Texture2D;
if (texture == null)
{
Debug.LogErrorFormat(fnt, "{0}: not found '{1}'.", typeof(BFImporter), texPath);
return;
}
TextureImporter texImporter = AssetImporter.GetAtPath(texPath) as TextureImporter;
texImporter.textureType = TextureImporterType.GUI;
texImporter.mipmapEnabled = false;
texImporter.SaveAndReimport();
font.material.mainTexture = texture;
font.material.mainTexture.name = "Font Texture";
font.characterInfo = parse.charInfos;
AssetDatabase.SaveAssets();
}
示例2: addSelectedObjects
void addSelectedObjects(){
MB2_MeshBakerRoot mom = (MB2_MeshBakerRoot) target;
if (mom == null){
Debug.LogError("Must select a target MeshBaker to add objects to");
return;
}
List<GameObject> newMomObjs = GetFilteredList();
MB_EditorUtil.RegisterUndo(mom, "Add Objects");
List<GameObject> momObjs = mom.GetObjectsToCombine();
int numAdded = 0;
for (int i = 0; i < newMomObjs.Count;i++){
if (!momObjs.Contains(newMomObjs[i])){
momObjs.Add(newMomObjs[i]);
numAdded++;
}
}
SerializedObject so = new SerializedObject(mom);
so.SetIsDifferentCacheDirty();
if (numAdded == 0){
Debug.LogWarning("Added 0 objects. Make sure some or all objects are selected in the hierarchy view. Also check ths 'Only Static Objects', 'Using Material' and 'Using Shader' settings");
} else {
Debug.Log("Added " + numAdded + " objects to " + mom.name);
}
}