本文整理匯總了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;
}