UnityEngine.Networking.NetworkScene.SetLocalObject C# (CSharp) Method

SetLocalObject() private method

private SetLocalObject ( NetworkInstanceId netId, GameObject obj, bool isClient, bool isServer ) : void
netId NetworkInstanceId
obj UnityEngine.GameObject
isClient bool
isServer bool
return void
        internal void SetLocalObject(NetworkInstanceId netId, GameObject obj, bool isClient, bool isServer)
        {
            if (LogFilter.logDev)
            {
                Debug.Log(string.Concat(new object[] { "SetLocalObject ", netId, " ", obj }));
            }
            if (obj == null)
            {
                this.m_LocalObjects[netId] = null;
            }
            else
            {
                NetworkIdentity component = null;
                if (this.m_LocalObjects.ContainsKey(netId))
                {
                    component = this.m_LocalObjects[netId];
                }
                if (component == null)
                {
                    component = obj.GetComponent<NetworkIdentity>();
                    this.m_LocalObjects[netId] = component;
                }
                component.UpdateClientServer(isClient, isServer);
            }
        }

Usage Example

 static public void SetLocalObject(NetworkInstanceId netId, GameObject obj)
 {
     // if still receiving initial state, dont set isClient
     s_NetworkScene.SetLocalObject(netId, obj, s_IsSpawnFinished, false);
 }
All Usage Examples Of UnityEngine.Networking.NetworkScene::SetLocalObject