mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
simplify with null coalesce
This commit is contained in:
parent
059730ca37
commit
f0723e50dd
@ -35,14 +35,10 @@ NetworkIdentity myView
|
||||
{
|
||||
get
|
||||
{
|
||||
m_MyView = m_MyView ?? GetComponent<NetworkIdentity>();
|
||||
if (m_MyView == null)
|
||||
{
|
||||
m_MyView = GetComponent<NetworkIdentity>();
|
||||
if (m_MyView == null)
|
||||
{
|
||||
if (LogFilter.logError) { Debug.LogError("There is no NetworkIdentity on this object. Please add one."); }
|
||||
}
|
||||
return m_MyView;
|
||||
if (LogFilter.logError) { Debug.LogError("There is no NetworkIdentity on this object. Please add one."); }
|
||||
}
|
||||
return m_MyView;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user