本文整理汇总了C#中Piece.SetSelectionTransparency方法的典型用法代码示例。如果您正苦于以下问题:C# Piece.SetSelectionTransparency方法的具体用法?C# Piece.SetSelectionTransparency怎么用?C# Piece.SetSelectionTransparency使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piece
的用法示例。
在下文中一共展示了Piece.SetSelectionTransparency方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPieceTouch
private void OnPieceTouch(Piece currentPiece, string id)
{
//Debug.Log("PositionOnBoard: " + currentPiece.tile.posOnBoard);
MeshRenderer mrCurrent = currentPiece.GetComponent<MeshRenderer>();
string selectedPieceColor = mrCurrent.material.color.ToHexStringRGB();
Debug.Log("currentPiece-> color: " + currentPiece.color + " size: " + currentPiece.size + " symbol: " + currentPiece.symbol);
if(selectedPiece != null)
{
if(currentPiece.MeetsPreconditions(selectedPiece)){
//Debug.Log("MeetsPreconditions...");
if(IsValidMove(currentPiece)){
/***if level = hard ****
MakeMovement(selectedPiece, currentPiece.tile);
MeshRenderer mr = selectedPiece.GetComponent<MeshRenderer>();
mr.material = currentMaterial;
*/
//if level = easy
MakeMovementPath(currentPiece.tile);
}
}
}
else
{
if(selectedPieceColor.Equals(activeBoardColor)){
if(currentPiece.MeetsPreconditions(selectedPiece))
{
selectedPiece = currentPiece;
initialPieceTile = currentPiece.tile;
initialPiece = currentPiece;
/* Set piece transparency*/
selectedPiece.SetSelectionTransparency();
MeshRenderer mr = selectedPiece.GetComponent<MeshRenderer>();
currentMaterial = mr.material;
/* Set selected color to piece*/
/*MeshRenderer mr = selectedPiece.GetComponent<MeshRenderer>();
currentMaterial = mr.material;
mr.material = Resources.Load("Material/OriginalTheme/selected") as Material;*/
}
}
}
}