当前位置: 首页>>代码示例>>C#>>正文


C# Zone.GetComponent方法代码示例

本文整理汇总了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();
 }
开发者ID:bloodyblaze,项目名称:rep-Mods,代码行数:7,代码来源:ZoneManager.cs

示例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);
 }
开发者ID:vividentity,项目名称:Oxide2Plugins,代码行数:7,代码来源:ZoneManager.cs

示例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");
        }
    }
开发者ID:schmjdt,项目名称:cpi211,代码行数:24,代码来源:GameLogic.cs

示例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);
 }
开发者ID:vividentity,项目名称:Oxide2Plugins,代码行数:6,代码来源:ZoneManager.cs

示例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();
 }
开发者ID:mpendel,项目名称:RUSTBOYS,代码行数:7,代码来源:ZoneManager.cs


注:本文中的Zone.GetComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。