void OnValidate() { if (m_SendInterval < 0) { m_SendInterval = 0; } if (m_SyncRotationAxis < NetworkTransform.AxisSyncMode.None || m_SyncRotationAxis > NetworkTransform.AxisSyncMode.AxisXYZ) { m_SyncRotationAxis = NetworkTransform.AxisSyncMode.None; } if (interpolateRotation < 0) { interpolateRotation = 0.01f; } if (interpolateRotation > 1.0f) { interpolateRotation = 1.0f; } if (interpolateMovement < 0) { interpolateMovement = 0.01f; } if (interpolateMovement > 1.0f) { interpolateMovement = 1.0f; } }
void OnValidate() { // root parent of target must have a NetworkTransform if (m_Target != null) { Transform parent = m_Target.parent; if (parent == null) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild target cannot be the root transform."); } m_Target = null; return; } while (parent.parent != null) { parent = parent.parent; } m_Root = parent.gameObject.GetComponent <NetworkTransform>(); if (m_Root == null) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild root must have NetworkTransform"); } m_Target = null; return; } } if (m_Root != null) { // childIndex is the index within all the NetworkChildTransforms on the root m_ChildIndex = UInt32.MaxValue; var childTransforms = m_Root.GetComponents <NetworkTransformChild>(); for (uint i = 0; i < childTransforms.Length; i++) { if (childTransforms[i] == this) { m_ChildIndex = i; break; } } if (m_ChildIndex == UInt32.MaxValue) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild component must be a child in the same hierarchy"); } m_Target = null; } } if (m_SendInterval < 0) { m_SendInterval = 0; } if (m_SyncRotationAxis < NetworkTransform.AxisSyncMode.None || m_SyncRotationAxis > NetworkTransform.AxisSyncMode.AxisXYZ) { m_SyncRotationAxis = NetworkTransform.AxisSyncMode.None; } if (movementThreshold < 0) { movementThreshold = 0.00f; } if (interpolateRotation < 0) { interpolateRotation = 0.01f; } if (interpolateRotation > 1.0f) { interpolateRotation = 1.0f; } if (interpolateMovement < 0) { interpolateMovement = 0.01f; } if (interpolateMovement > 1.0f) { interpolateMovement = 1.0f; } }
private void OnValidate() { if (this.m_Target != null) { Transform parent = this.m_Target.parent; if (parent == null) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild target cannot be the root transform."); } this.m_Target = null; return; } while (parent.parent != null) { parent = parent.parent; } this.m_Root = parent.gameObject.GetComponent <NetworkTransform>(); if (this.m_Root == null) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild root must have NetworkTransform"); } this.m_Target = null; return; } } if (this.m_Root != null) { this.m_ChildIndex = uint.MaxValue; NetworkTransformChild[] components = this.m_Root.GetComponents <NetworkTransformChild>(); uint num = 0u; while ((ulong)num < (ulong)((long)components.Length)) { if (components[(int)((UIntPtr)num)] == this) { this.m_ChildIndex = num; break; } num += 1u; } if (this.m_ChildIndex == 4294967295u) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild component must be a child in the same hierarchy"); } this.m_Target = null; } } if (this.m_SendInterval < 0f) { this.m_SendInterval = 0f; } if (this.m_SyncRotationAxis < NetworkTransform.AxisSyncMode.None || this.m_SyncRotationAxis > NetworkTransform.AxisSyncMode.AxisXYZ) { this.m_SyncRotationAxis = NetworkTransform.AxisSyncMode.None; } if (this.movementThreshold < 0f) { this.movementThreshold = 0f; } if (this.interpolateRotation < 0f) { this.interpolateRotation = 0.01f; } if (this.interpolateRotation > 1f) { this.interpolateRotation = 1f; } if (this.interpolateMovement < 0f) { this.interpolateMovement = 0.01f; } if (this.interpolateMovement > 1f) { this.interpolateMovement = 1f; } }
private void OnValidate() { if ((UnityEngine.Object) this.m_Target != (UnityEngine.Object) null) { Transform parent = this.m_Target.parent; if ((UnityEngine.Object) parent == (UnityEngine.Object) null) { if (LogFilter.logError) Debug.LogError((object) "NetworkTransformChild target cannot be the root transform."); this.m_Target = (Transform) null; return; } while ((UnityEngine.Object) parent.parent != (UnityEngine.Object) null) parent = parent.parent; this.m_Root = parent.gameObject.GetComponent<NetworkTransform>(); if ((UnityEngine.Object) this.m_Root == (UnityEngine.Object) null) { if (LogFilter.logError) Debug.LogError((object) "NetworkTransformChild root must have NetworkTransform"); this.m_Target = (Transform) null; return; } } this.m_ChildIndex = uint.MaxValue; NetworkTransformChild[] components = this.m_Root.GetComponents<NetworkTransformChild>(); for (uint index = 0; (long) index < (long) components.Length; ++index) { if ((UnityEngine.Object) components[(IntPtr) index] == (UnityEngine.Object) this) { this.m_ChildIndex = index; break; } } if ((int) this.m_ChildIndex == -1) { if (LogFilter.logError) Debug.LogError((object) "NetworkTransformChild component must be a child in the same hierarchy"); this.m_Target = (Transform) null; } if ((double) this.m_SendInterval < 0.0) this.m_SendInterval = 0.0f; if (this.m_SyncRotationAxis < NetworkTransform.AxisSyncMode.None || this.m_SyncRotationAxis > NetworkTransform.AxisSyncMode.AxisXYZ) this.m_SyncRotationAxis = NetworkTransform.AxisSyncMode.None; if ((double) this.movementThreshold < 0.0) this.movementThreshold = 0.0f; if ((double) this.interpolateRotation < 0.0) this.interpolateRotation = 0.01f; if ((double) this.interpolateRotation > 1.0) this.interpolateRotation = 1f; if ((double) this.interpolateMovement < 0.0) this.interpolateMovement = 0.01f; if ((double) this.interpolateMovement <= 1.0) return; this.interpolateMovement = 1f; }
private void OnValidate() { if (this.m_TransformSyncMode < NetworkTransform.TransformSyncMode.SyncNone || this.m_TransformSyncMode > NetworkTransform.TransformSyncMode.SyncCharacterController) this.m_TransformSyncMode = NetworkTransform.TransformSyncMode.SyncTransform; if ((double) this.m_SendInterval < 0.0) this.m_SendInterval = 0.0f; if (this.m_SyncRotationAxis < NetworkTransform.AxisSyncMode.None || this.m_SyncRotationAxis > NetworkTransform.AxisSyncMode.AxisXYZ) this.m_SyncRotationAxis = NetworkTransform.AxisSyncMode.None; if ((double) this.m_MovementTheshold < 0.0) this.m_MovementTheshold = 0.0f; if ((double) this.m_SnapThreshold < 0.0) this.m_SnapThreshold = 0.01f; if ((double) this.m_InterpolateRotation < 0.0) this.m_InterpolateRotation = 0.01f; if ((double) this.m_InterpolateMovement >= 0.0) return; this.m_InterpolateMovement = 0.01f; }
private void OnValidate() { if (this.m_Target != null) { Transform parent = this.m_Target.parent; if (parent == null) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild target cannot be the root transform."); } this.m_Target = null; return; } while (parent.parent != null) { parent = parent.parent; } this.m_Root = parent.gameObject.GetComponent <NetworkTransform>(); if (this.m_Root == null) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild root must have NetworkTransform"); } this.m_Target = null; return; } } this.m_ChildIndex = uint.MaxValue; NetworkTransformChild[] components = this.m_Root.GetComponents <NetworkTransformChild>(); for (uint i = 0; i < components.Length; i++) { if (components[i] == this) { this.m_ChildIndex = i; break; } } if (this.m_ChildIndex == uint.MaxValue) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild component must be a child in the same hierarchy"); } this.m_Target = null; } if (this.m_SendInterval < 0f) { this.m_SendInterval = 0f; } if ((this.m_SyncRotationAxis < NetworkTransform.AxisSyncMode.None) || (this.m_SyncRotationAxis > NetworkTransform.AxisSyncMode.AxisXYZ)) { this.m_SyncRotationAxis = NetworkTransform.AxisSyncMode.None; } if (this.movementThreshold < 0f) { this.movementThreshold = 0f; } if (this.interpolateRotation < 0f) { this.interpolateRotation = 0.01f; } if (this.interpolateRotation > 1f) { this.interpolateRotation = 1f; } if (this.interpolateMovement < 0f) { this.interpolateMovement = 0.01f; } if (this.interpolateMovement > 1f) { this.interpolateMovement = 1f; } }
private void OnValidate() { if ((UnityEngine.Object) this.m_Target != (UnityEngine.Object)null) { Transform parent = this.m_Target.parent; if ((UnityEngine.Object)parent == (UnityEngine.Object)null) { if (LogFilter.logError) { Debug.LogError((object)"NetworkTransformChild target cannot be the root transform."); } this.m_Target = (Transform)null; return; } while ((UnityEngine.Object)parent.parent != (UnityEngine.Object)null) { parent = parent.parent; } this.m_Root = parent.gameObject.GetComponent <NetworkTransform>(); if ((UnityEngine.Object) this.m_Root == (UnityEngine.Object)null) { if (LogFilter.logError) { Debug.LogError((object)"NetworkTransformChild root must have NetworkTransform"); } this.m_Target = (Transform)null; return; } } this.m_ChildIndex = uint.MaxValue; NetworkTransformChild[] components = this.m_Root.GetComponents <NetworkTransformChild>(); for (uint index = 0; (long)index < (long)components.Length; ++index) { if ((UnityEngine.Object)components[(IntPtr)index] == (UnityEngine.Object) this) { this.m_ChildIndex = index; break; } } if ((int)this.m_ChildIndex == -1) { if (LogFilter.logError) { Debug.LogError((object)"NetworkTransformChild component must be a child in the same hierarchy"); } this.m_Target = (Transform)null; } if ((double)this.m_SendInterval < 0.0) { this.m_SendInterval = 0.0f; } if (this.m_SyncRotationAxis < NetworkTransform.AxisSyncMode.None || this.m_SyncRotationAxis > NetworkTransform.AxisSyncMode.AxisXYZ) { this.m_SyncRotationAxis = NetworkTransform.AxisSyncMode.None; } if ((double)this.movementThreshold < 0.0) { this.movementThreshold = 0.0f; } if ((double)this.interpolateRotation < 0.0) { this.interpolateRotation = 0.01f; } if ((double)this.interpolateRotation > 1.0) { this.interpolateRotation = 1f; } if ((double)this.interpolateMovement < 0.0) { this.interpolateMovement = 0.01f; } if ((double)this.interpolateMovement <= 1.0) { return; } this.interpolateMovement = 1f; }
private void OnValidate() { if (this.m_Target != null) { Transform parent = this.m_Target.parent; if (parent == null) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild target cannot be the root transform."); } this.m_Target = null; return; } while (parent.parent != null) { parent = parent.parent; } this.m_Root = parent.gameObject.GetComponent<NetworkTransform>(); if (this.m_Root == null) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild root must have NetworkTransform"); } this.m_Target = null; return; } } this.m_ChildIndex = uint.MaxValue; NetworkTransformChild[] components = this.m_Root.GetComponents<NetworkTransformChild>(); for (uint i = 0; i < components.Length; i++) { if (components[i] == this) { this.m_ChildIndex = i; break; } } if (this.m_ChildIndex == uint.MaxValue) { if (LogFilter.logError) { Debug.LogError("NetworkTransformChild component must be a child in the same hierarchy"); } this.m_Target = null; } if (this.m_SendInterval < 0f) { this.m_SendInterval = 0f; } if ((this.m_SyncRotationAxis < NetworkTransform.AxisSyncMode.None) || (this.m_SyncRotationAxis > NetworkTransform.AxisSyncMode.AxisXYZ)) { this.m_SyncRotationAxis = NetworkTransform.AxisSyncMode.None; } if (this.movementThreshold < 0f) { this.movementThreshold = 0f; } if (this.interpolateRotation < 0f) { this.interpolateRotation = 0.01f; } if (this.interpolateRotation > 1f) { this.interpolateRotation = 1f; } if (this.interpolateMovement < 0f) { this.interpolateMovement = 0.01f; } if (this.interpolateMovement > 1f) { this.interpolateMovement = 1f; } }