本文整理汇总了C#中Zone.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# Zone.GetComponent方法的具体用法?C# Zone.GetComponent怎么用?C# Zone.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone.GetComponent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EjectPlayer
static void EjectPlayer(Zone zone, BasePlayer player)
{
cachedDirection = player.transform.position - zone.transform.position;
player.transform.position = zone.transform.position + (cachedDirection / cachedDirection.magnitude * (zone.GetComponent<UnityEngine.SphereCollider>().radius + 1f));
player.ClientRPCPlayer(null, player, "ForcePositionTo", new object[] { player.transform.position });
player.TransformChanged();
}
示例2: EjectPlayer
static void EjectPlayer(Zone zone, PlayerClient player)
{
cachedDirection = player.lastKnownPosition - zone.transform.position;
player.lastKnownPosition = zone.transform.position + (cachedDirection / cachedDirection.magnitude * (zone.GetComponent<UnityEngine.SphereCollider>().radius + 2f));
management.TeleportPlayerToWorld(player.netPlayer, player.lastKnownPosition);
Interface.CallHook("IsCollidingEject",zone, player);
}
示例3: moveDie
public static void moveDie(Die die, Zone zoneTo)
{
if (zoneTo != null)
{
// Try to update the Die's Old Zones' and New Zones' GameZone Die[]
//Zone oldP = d.GetComponent<Draggable>().getParentZone();
// Use oldP and z to get gameLayout to update their dice/color
//Debug.Log("Moving die to " + zoneTo.zoneName);
die.GetComponent<Draggable>().setParentZone(zoneTo);
die.transform.SetParent(zoneTo.holders.diceHolder);
Vector3 boxSize = zoneTo.GetComponent<BoxCollider>().size;
die.offsetMargin.x = boxSize.x * zoneTo.transform.localScale.x * die.transform.localScale.x;
die.offsetMargin.z = boxSize.y * zoneTo.transform.localScale.y * die.transform.localScale.z;
die.moveDie(0, 0, 0);
die.offsetDie();
} else
{
Debug.Log("Zone moving to doesn't exist");
}
}
示例4: AttractPlayer
static void AttractPlayer(Zone zone, PlayerClient player)
{
cachedDirection = player.lastKnownPosition - zone.transform.position;
player.lastKnownPosition = zone.transform.position + (cachedDirection / cachedDirection.magnitude * (zone.GetComponent<UnityEngine.SphereCollider>().radius - 2f));
management.TeleportPlayerToWorld(player.netPlayer, player.lastKnownPosition);
}
示例5: AttractPlayer
private static void AttractPlayer(Zone zone, BasePlayer player)
{
var cachedDirection = player.transform.position - zone.transform.position;
player.MovePosition(zone.transform.position + (cachedDirection / cachedDirection.magnitude * (zone.GetComponent<SphereCollider>().radius - 1f)));
player.ClientRPCPlayer(null, player, "ForcePositionTo", new object[] { player.transform.position });
player.TransformChanged();
}