当前位置: 首页>>代码示例>>C#>>正文


C# Color32.Equals方法代码示例

本文整理汇总了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;
 }
开发者ID:sarkahn,项目名称:unityroguetest,代码行数:7,代码来源:RLMap.cs

示例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;
     }
 }
开发者ID:ConnorUllmann,项目名称:P2IceCream,代码行数:35,代码来源:TileManager.cs

示例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();
    }
开发者ID:happyjiahan,项目名称:colorus,代码行数:11,代码来源:MainColorSelectController.cs

示例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;
	}
开发者ID:Ahere,项目名称:infinite-road,代码行数:15,代码来源:ColorRandomizerBehavior.cs

示例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;
    }
开发者ID:TheNorthEestern,项目名称:infinite-road,代码行数:16,代码来源:ColorRandomizerBehavior.cs


注:本文中的UnityEngine.Color32.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。