本文整理汇总了C#中Cell.WorldPos方法的典型用法代码示例。如果您正苦于以下问题:C# Cell.WorldPos方法的具体用法?C# Cell.WorldPos怎么用?C# Cell.WorldPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cell
的用法示例。
在下文中一共展示了Cell.WorldPos方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpawnPiece
public void SpawnPiece(Type piece, Cell target)
{
if (target.IsSolidlyOccupied()) return;
GameObject parent = GetPieceParent(piece);
GameObject obj = (GameObject)PrefabUtility.InstantiatePrefab(GamePiece.GetPrefab(selectedPiece));
obj.transform.position = target.WorldPos();
obj.transform.parent = parent.transform;
RoomManager.roomManager.AddPiece(obj, piece);
}
示例2: SpawnPlayer
public void SpawnPlayer(Cell target)
{
if (RoomManager.roomManager.player == null)
{
GameObject obj = (GameObject)PrefabUtility.InstantiatePrefab(GamePiece.GetPrefab(typeof(Player)));
obj.transform.position = target.WorldPos();
RoomManager.roomManager.AddPiece(obj, typeof(Player));
}
else
{
RoomManager.roomManager.player.TeleportTo(target);
}
}
示例3: StartLerp
public bool StartLerp(Cell source, Cell dest, float speed, Side? s = null)
{
bool available = dest.Reserve() && dest != null;
if (available)
{
isMoving = true;
StartPos = source.WorldPos();
destination = dest;
tempSpeed = speed;
currentLerp = 0f;
currentRot = transform.eulerAngles;
targetRot = s;
}
return available;
}