本文整理汇总了C#中BasePlayer.?.GetNetworkRotation方法的典型用法代码示例。如果您正苦于以下问题:C# BasePlayer.?.GetNetworkRotation方法的具体用法?C# BasePlayer.?.GetNetworkRotation怎么用?C# BasePlayer.?.GetNetworkRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasePlayer
的用法示例。
在下文中一共展示了BasePlayer.?.GetNetworkRotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateZoneDefinition
private void UpdateZoneDefinition(ZoneDefinition zone, string[] args, BasePlayer player = null)
{
for (var i = 0; i < args.Length; i = i + 2)
{
object editvalue;
switch (args[i].ToLower())
{
case "name":
editvalue = zone.name = args[i + 1];
break;
case "id":
editvalue = zone.ID = args[i + 1];
break;
case "radiation":
editvalue = zone.radiation = float.Parse(args[i + 1]);
break;
case "radius":
editvalue = zone.radius = float.Parse(args[i + 1]);
break;
case "rotation":
zone.Rotation = player?.GetNetworkRotation() ?? Vector3.zero;/* + Quaternion.AngleAxis(90, Vector3.up).eulerAngles*/
zone.Rotation.x = 0;
editvalue = zone.Rotation;
break;
case "size":
var size = args[i + 1].Trim().Split(' ');
if (size.Length == 3)
editvalue = zone.Size = new Vector3(float.Parse(size[0]), float.Parse(size[1]), float.Parse(size[2]));
else
{
if (player != null) SendMessage(player, "Invalid size format, use: \"x y z\"");
continue;
}
break;
case "enter_message":
editvalue = zone.enter_message = args[i + 1];
break;
case "leave_message":
editvalue = zone.leave_message = args[i + 1];
break;
case "enabled":
case "enable":
editvalue = zone.enabled = GetBoolValue(args[i + 1]);
break;
default:
try
{
var flag = (ZoneFlags)Enum.Parse(typeof(ZoneFlags), args[i], true);
var boolValue = GetBoolValue(args[i + 1]);
editvalue = boolValue;
if (boolValue) AddZoneFlag(zone, flag);
else RemoveZoneFlag(zone, flag);
}
catch
{
if (player != null) SendMessage(player, $"Unknown zone flag: {args[i]}");
continue;
}
break;
}
if (player != null) SendMessage(player, $"{args[i]} set to {editvalue}");
}
}