public static IDRemote DoLocalAppend(IDRemote localAppend, IDMain instance, Transform appendPoint) { Transform transform = localAppend.transform; if (localAppend.transform != localAppend.transform.root) { Debug.LogWarning("The localAppend transform was not a root"); } IDRemote remote = (IDRemote)UnityEngine.Object.Instantiate(localAppend, appendPoint.TransformPoint(transform.localPosition), appendPoint.rotation * transform.localRotation); Transform transform2 = remote.transform; transform2.parent = appendPoint; transform2.localPosition = transform.localPosition; transform2.localRotation = transform.localRotation; transform2.localScale = transform.localScale; remote.idMain = instance; foreach (IDRemote remote2 in instance.GetComponentsInChildren <IDRemote>()) { if (remote2.idMain == null) { remote2.idMain = instance; } } return(remote); }
public static IDRemote DoLocalAppend(IDRemote localAppend, IDMain instance, Transform appendPoint) { Transform transforms = localAppend.transform; if (localAppend.transform != localAppend.transform.root) { Debug.LogWarning("The localAppend transform was not a root"); } IDRemote dRemote = (IDRemote)UnityEngine.Object.Instantiate(localAppend, appendPoint.TransformPoint(transforms.localPosition), appendPoint.rotation * transforms.localRotation); Transform transforms1 = dRemote.transform; transforms1.parent = appendPoint; transforms1.localPosition = transforms.localPosition; transforms1.localRotation = transforms.localRotation; transforms1.localScale = transforms.localScale; dRemote.idMain = instance; IDRemote[] componentsInChildren = instance.GetComponentsInChildren <IDRemote>(); for (int i = 0; i < (int)componentsInChildren.Length; i++) { IDRemote dRemote1 = componentsInChildren[i]; if (!dRemote1.idMain) { dRemote1.idMain = instance; } } return(dRemote); }
protected virtual void StandardInitialization(bool didAppend, IDRemote appended, NetInstance instance, Facepunch.NetworkView view, ref uLink.NetworkMessageInfo info) { if (didAppend) { IssueLocallyAppended(appended, instance.idMain); } if (this.ShouldDoStandardInitialization(instance)) { NetworkInstantiatorUtility.BroadcastOnNetworkInstantiate(view, "uLink_OnNetworkInstantiate", info); } }
protected override void StandardInitialization(bool didAppend, IDRemote appended, NetInstance instance, Facepunch.NetworkView view, ref uLink.NetworkMessageInfo info) { Controllable controllable = ((Character)instance.idMain).controllable; controllable.PrepareInstantiate(view, ref info); base.StandardInitialization(false, appended, instance, view, ref info); if (didAppend) { NetMainPrefab.IssueLocallyAppended(appended, instance.idMain); } controllable.OnInstantiated(); }
// Token: 0x06002175 RID: 8565 RVA: 0x0007B318 File Offset: 0x00079518 protected uLink.NetworkView _Creator(string prefabName, NetworkInstantiateArgs args, uLink.NetworkMessageInfo info) { global::NetInstance netInstance = this.Summon(this.proxyPrefab, false, ref args); if (!netInstance) { return(null); } Facepunch.NetworkView networkView = netInstance.networkView; if (!networkView) { return(null); } info = new uLink.NetworkMessageInfo(info, networkView); global::NetInstance currentNetInstance = global::NetMainPrefab._currentNetInstance; try { global::NetMainPrefab._currentNetInstance = netInstance; netInstance.info = info; netInstance.prepared = true; global::NetInstance netInstance2 = netInstance; uLink.NetworkViewID viewID = args.viewID; netInstance2.local = viewID.isMine; bool didAppend = false; IDRemote appended = null; if (netInstance.local) { IDRemote localAppend = this.localAppend; if (localAppend) { appended = global::NetMainPrefab.DoLocalAppend(localAppend, netInstance.idMain, this.GetLocalAppendTransform(netInstance.idMain)); didAppend = true; } } netInstance.zzz___onprecreate(); this.StandardInitialization(didAppend, appended, netInstance, networkView, ref info); netInstance.zzz___onpostcreate(); } finally { global::NetMainPrefab._currentNetInstance = currentNetInstance; } return(networkView); }
protected NetworkView _Creator(string prefabName, NetworkInstantiateArgs args, NetworkMessageInfo info) { NetInstance instance = this.Summon(this.proxyPrefab, false, ref args); if (instance == null) { return(null); } NetworkView networkView = instance.networkView; if (networkView == null) { return(null); } info = new NetworkMessageInfo(info, networkView); NetInstance instance2 = _currentNetInstance; try { _currentNetInstance = instance; instance.info = info; instance.prepared = true; instance.local = args.viewID.isMine; bool didAppend = false; IDRemote appended = null; if (instance.local) { IDRemote localAppend = this.localAppend; if (localAppend != null) { appended = DoLocalAppend(localAppend, instance.idMain, this.GetLocalAppendTransform(instance.idMain)); didAppend = true; } } instance.zzz___onprecreate(); this.StandardInitialization(didAppend, appended, instance, networkView, ref info); instance.zzz___onpostcreate(); } finally { _currentNetInstance = instance2; } return(networkView); }
protected uLink.NetworkView _Creator(string prefabName, NetworkInstantiateArgs args, uLink.NetworkMessageInfo info) { NetInstance netInstance = this.Summon(this.proxyPrefab, false, ref args); if (!netInstance) { return(null); } Facepunch.NetworkView networkView = netInstance.networkView; if (!networkView) { return(null); } info = new uLink.NetworkMessageInfo(info, networkView); NetInstance netInstance1 = NetMainPrefab._currentNetInstance; try { NetMainPrefab._currentNetInstance = netInstance; netInstance.info = info; netInstance.prepared = true; netInstance.local = args.viewID.isMine; bool flag = false; IDRemote dRemote = null; if (netInstance.local) { IDRemote dRemote1 = this.localAppend; if (dRemote1) { dRemote = NetMainPrefab.DoLocalAppend(dRemote1, netInstance.idMain, this.GetLocalAppendTransform(netInstance.idMain)); flag = true; } } netInstance.zzz___onprecreate(); this.StandardInitialization(flag, dRemote, netInstance, networkView, ref info); netInstance.zzz___onpostcreate(); } finally { NetMainPrefab._currentNetInstance = netInstance1; } return(networkView); }
public static bool IsCurrentlyDestroying(IDRemote remote) { NetInstance current = NetInstance.current; return((current != null) && (current.idMain == remote.idMain)); }
public static void IssueLocallyAppended(IDRemote appended, IDMain instance) { appended.BroadcastMessage("OnLocallyAppended", instance, SendMessageOptions.DontRequireReceiver); }
public static bool IsCurrentlyDestroying(IDRemote remote) { NetInstance netInstance = NetInstance.current; return (!netInstance ? false : netInstance.idMain == remote.idMain); }
public static bool IsCurrentlyDestroying(IDRemote remote) { NetInstance netInstance = NetInstance.current; return(!netInstance ? false : netInstance.idMain == remote.idMain); }
// Token: 0x06002172 RID: 8562 RVA: 0x0007B1FC File Offset: 0x000793FC public static void IssueLocallyAppended(IDRemote appended, IDMain instance) { appended.BroadcastMessage("OnLocallyAppended", instance, 1); }
// Token: 0x06002158 RID: 8536 RVA: 0x0007AD0C File Offset: 0x00078F0C public static bool IsCurrentlyDestroying(IDRemote remote) { global::NetInstance current = global::NetInstance.current; return(current && current.idMain == remote.idMain); }