本文整理汇总了C#中UnityEngine.Color32.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Color32.Equals方法的具体用法?C# Color32.Equals怎么用?C# Color32.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Color32
的用法示例。
在下文中一共展示了Color32.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetTile
public void SetTile( int x, int y, char character, Color32 color = default(Color32) )
{
if (color.Equals( default(Color32)) )
color = Color.white;
tiles_[x,y] = character;
colors_[x,y] = color;
}
示例2: ColorToObject
// determines the game object corresponding to the given color
GameObject ColorToObject(Color32 color) {
if (color.Equals(playerSpawnColor)) {
return playerPrefab;
}
else if (color.Equals(tileColor)) {
return tilePrefab;
}
else if (color.Equals(enemySpawnColor)) {
return enemySpawnerPrefab;
}
else if (color.Equals(airColor)) {
return null;
}
else if (color.Equals(pinkColor)) {
GameObject prefab = fountainPrefab;
prefab.GetComponent<Fountain>().iceCreamType = Utils.IceCream.Pink;
return prefab;
}
else if (color.Equals(vanillaColor)) {
GameObject prefab = fountainPrefab;
prefab.GetComponent<Fountain>().iceCreamType = Utils.IceCream.White;
return prefab;
}
else if (color.Equals(brownColor)) {
GameObject prefab = fountainPrefab;
prefab.GetComponent<Fountain>().iceCreamType = Utils.IceCream.Brown;
return prefab;
}
else {
print("An unrecognized color was found in the map! Something is wrong!");
print(color);
return null;
}
}
示例3: onSelectColorListener
void onSelectColorListener(Color32 color)
{
if (!color.Equals(PropertiesSingleton.instance.colorProperties.activeColor)){
Color32 oldColor = PropertiesSingleton.instance.colorProperties.activeColor;
PropertiesSingleton.instance.colorProperties.activeColor = color;
if (WorkspaceEventManager.instance.onColorChanged!=null)
WorkspaceEventManager.instance.onColorChanged(color,oldColor);
}
updateMaterials();
}
示例4: generateRandomColor
private Color32 generateRandomColor(Color32 mix) {
System.Random random = new System.Random();
byte red = (byte) random.Next(256);
byte green = (byte) random.Next(256);
byte blue = (byte) random.Next(256);
if (!mix.Equals(null)) {
red = (byte) ((red + mix.r) / 2);
green = (byte) ((green + mix.g) / 2);
blue = (byte) ((blue + mix.b) / 2);
}
Color32 color = new Color32(red, green, blue, 255);
return color;
}
示例5: generateRandomColor
private Color32 generateRandomColor(Color32 mix)
{
// UnityEngine.Random random = new UnityEngine.Random();
byte red = (byte) Random.Range(0,256);
byte green = (byte) Random.Range(0,256);
byte blue = (byte) Random.Range(0,256);
if (!mix.Equals(null)) {
red = (byte) ((red + mix.r) / 2);
green = (byte) ((green + mix.g) / 2);
blue = (byte) ((blue + mix.b) / 2);
}
Color32 color = new Color32(red, green, blue, 255);
return color;
}