本文整理汇总了C#中Entity.GetEntityType方法的典型用法代码示例。如果您正苦于以下问题:C# Entity.GetEntityType方法的具体用法?C# Entity.GetEntityType怎么用?C# Entity.GetEntityType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity.GetEntityType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateSelection
public override bool ValidateSelection(Entity entity)
{
if (entity.GetEntityType() != "Tile")
return false;
Tile tile = entity as Tile;
if (tile.Occupied)
return false;
if (!tile.Walkable)
return false;
Tile playerTile = character.currentTile;
int xDif = Mathf.Abs(playerTile.X - tile.X);
if (xDif > moveRange)
return false;
int yDif = Mathf.Abs(playerTile.Y - tile.Y);
if (yDif > moveRange)
return false;
if ((xDif + yDif) > moveRange)
return false;
return character.GetActionPoints() > 0;
}
示例2: OnSelctionAction
public override void OnSelctionAction(Entity entity)
{
if (entity.GetEntityType() != "SlideCharacter") return;
var slide = entity as SlideCharacter;
if (slide.Team != team) return;
if (selectedCharacter)
{
ConflictController.Instance.RemovePulseMaterial(selectedCharacter.GetComponent<Renderer>());
}
selectedCharacter = entity as SlideCharacter;
AbilityButtonControl.Instance.ChangeSelectedCharacter(slide);
GridController.DisplayMoveRange(selectedCharacter);
ConflictController.Instance.AddPulseMaterial(selectedCharacter.Avatar.GetComponent<Renderer>());
}
示例3: ValidateSelection
public override bool ValidateSelection(Entity entity)
{
if (character.GetActionPoints() <= 0) return false;
switch (targetType)
{
case TargetType.Character:
if (entity.GetEntityType() != "SlideCharacter")
{
return false;
}
SlideCharacter ch = entity as SlideCharacter;
switch (targetFilter)
{
case TargetFilter.Enemy:
if (ch.Team == character.Team) return false;
break;
case TargetFilter.Freindly:
if (ch.Team != character.Team) return false;
break;
default:
break;
}
break;
case TargetType.Tile:
if (entity.GetEntityType() != "Tile") return false;
break;
case TargetType.Either:
if (entity.GetEntityType() != "Tile" && entity.GetEntityType() != "SlideCharacter") return false;
break;
case TargetType.Self:
if (entity != character) return false;
break;
default:
return false;
}
var tile = entity.getCurrentTile();
int xDif = Mathf.Abs(tile.X - character.currentTile.X);
if (xDif > range)
{
return false;
}
int yDif = Mathf.Abs(tile.Y - character.currentTile.Y);
if (yDif > range)
{
return false;
}
int total = xDif + yDif;
if (targetRange == TargetRange.Melee)
{
if (total > 2)
{
return false;
}
}
else
{
if (total > (range * 2))
{
return false;
}
}
return true;
}
示例4: OnEntitySelection
public bool OnEntitySelection(Entity entity)
{
if (entity.GetEntityType() == "Tile")
currentAction = allowedActions["Move"];
if (currentAction.ValidateSelection(entity) == false)
{
return false;
}
currentAction.PreformAction(entity);
currentAction = fallbackAction;
return true;
}