本文整理汇总了C#中ListDictionary.ContainsValue方法的典型用法代码示例。如果您正苦于以下问题:C# ListDictionary.ContainsValue方法的具体用法?C# ListDictionary.ContainsValue怎么用?C# ListDictionary.ContainsValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListDictionary
的用法示例。
在下文中一共展示了ListDictionary.ContainsValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindSpriteNamesInAllScene
public static void FindSpriteNamesInAllScene()
{
ListDictionary<string, string> spriteNames = new ListDictionary<string, string>();
string[] scenes = (from scene in EditorBuildSettings.scenes where scene.enabled select scene.path).ToArray();
foreach (string scene in scenes)
{
EditorApplication.OpenScene(scene);
Transform[] allTrnasforms = GameObject.FindObjectsOfType<Transform>();
foreach (Transform transform in allTrnasforms)
{
UISprite sprite = transform.GetComponent<UISprite>();
if (sprite != null && !spriteNames.ContainsValue(scene, sprite.spriteName))
spriteNames.Add(scene, sprite.spriteName);
}
}
string log = string.Empty;
foreach (string scene in scenes)
{
if (!spriteNames.ContainsKey(scene))
continue;
log += string.Format("Scene : {0}\n", scene);
string spriteNameInScene = string.Empty;
foreach (string spriteName in spriteNames[scene])
spriteNameInScene += string.Format("{0}\n", spriteName);
log += string.Format("{0}\n\n", spriteNameInScene);
}
Debug.LogWarning(log);
}