浏览代码

Quick compiler error fix

LayerMask.GetMask apparently doesn't like being called in constructor/static readonly field initializer
/main
Philipp Deschain 4 年前
当前提交
0026a1fd
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 5
      Assets/BossRoom/Scripts/Client/ClientInputSender.cs

5
Assets/BossRoom/Scripts/Client/ClientInputSender.cs


[RequireComponent(typeof(NetworkCharacterState))]
public class ClientInputSender : NetworkedBehaviour
{
private static readonly int NPCLayerMask = LayerMask.GetMask("NPCs");
private int m_NPCLayerMask;
private NetworkCharacterState m_NetworkCharacter;
/// <summary>

void Awake()
{
m_NPCLayerMask = LayerMask.GetMask("NPCs");
m_NetworkCharacter = GetComponent<NetworkCharacterState>();
}

m_NetworkCharacter.ClientSendActionRequest(ref chase_data);
//TODO fixme: there needs to be a better way to check if target is a PC or an NPC
bool isTargetingNPC = hit.transform.gameObject.layer == NPCLayerMask;
bool isTargetingNPC = hit.transform.gameObject.layer == m_NPCLayerMask;
if (isTargetingNPC)
{

正在加载...
取消
保存