當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。