protected virtual void Awake() { activePlayer = null; smoothYaw = new SmoothFloat(); smoothPitch = new SmoothFloat(); smoothTransform = gameObject.EnsureComponent <SmoothTransform>(); syncedObject = gameObject.EnsureComponent <SyncedObject>(); }
private void LoadTestConfigs() { SmoothTransform smooth = TerrainControl.Instance.transformSet[TransformIndex.Smooth] as SmoothTransform; SmoothSimConfigs smoothConfigs = smooth.Configs; WindDecayDigTransform windDecay = TerrainControl.Instance.transformSet[TransformIndex.WindDecayDig] as WindDecayDigTransform; WindDecaySimConfigs windDecayConfigs = windDecay.Configs; SimulationConfigsScreen.UIControl.SmoothConfigs = smoothConfigs; SimulationConfigsScreen.UIControl.WindDecayConfigs = windDecayConfigs; GameControl.Instance.SetBackgroundMode(true); SceneManager.LoadScene("TestConfigs", LoadSceneMode.Additive); }
/*// RPC call from server in situation when transformation data from owner ARE VALID * // @see StrictCharacterCreator.ServerUpdate() * [uSuite.RPC] * void GoodOwnerPos( uLink.NetworkMessageInfo info ) * { * Move goodMove; * goodMove.timestamp = info.timestamp; * goodMove.deltaTime = 0; * goodMove.vel = Vector3.zero; * * int index = ownerMoves.BinarySearch( goodMove ); * if (index < 0) index = ~index; * * ownerMoves.RemoveRange(0, index); * } * * // RPC call from server in situation when transformation data from owner ARE NOT VALID * // @see StrictCharacterCreator.ServerUpdate() * [uSuite.RPC] * void AdjustOwnerPos( Vector3 pos, uLink.NetworkMessageInfo info ) * { * GoodOwnerPos( info ); * * m_Transform.position = pos; * * foreach( Move move in ownerMoves ) * { * Owner.CharacterController.Move( move.vel * move.deltaTime ); * } * } */ // @see StrictCharacterCreator.uLink_OnSerializeNetworkView() void uLink_OnSerializeNetworkViewOwner(uLink.BitStream stream, uLink.NetworkMessageInfo info) { Vector3 pos = stream.Read <Vector3>(); Quaternion rot = stream.Read <Quaternion>(); Vector3 vel = stream.Read <Vector3>(); if (null != SmoothTransformKnockdown) { double timestamp = SmoothTransform.GetTime(info); SmoothTransformKnockdown.AddState(timestamp, pos, vel, rot); } else { SetTransform(pos, rot, vel); } }
public void Create() { var attachObject = new GameObject(); attacher = attachObject.AddComponent <Attacher>(); attacher.name = "Attacher Body (" + this.username + ")"; body = UnityEngine.Object.Instantiate(baseObject); body.SetActive(true); body.transform.parent = attacher.transform; smoothTransform = body.EnsureComponent <SmoothTransform>(); playerView = body.transform.Find("player_view").gameObject; animator = playerView.EnsureComponent <RemotePlayerAnimator>(); animator.inventory = inventory; animator.main.ResetParameters(); animator.main.SetBool("diving", false); animator.main.SetBool("diving_land", false); animator.main.SetBool("grab", false); animator.main.SetBool("bash", false); animator.main.SetBool("bleeder", false); animator.main.SetBool("jump", false); animator.main.SetBool("is_underwater", false); animator.main.SetBool("in_seamoth", false); animator.main.SetBool("in_exosuit", false); animator.main.SetBool("using_mechsuit", false); animator.main.SetBool("cinematics_enabled", false); animator.main.SetBool("on_surface", false); animator.main.SetFloat("verticalOffset", 0f); var signalBase = UnityEngine.Object.Instantiate(Resources.Load("VFX/xSignal")) as GameObject; signalBase.name = "signal" + username; signalBase.transform.localScale = new Vector3(.5f, .5f, .5f); signalBase.transform.localPosition += new Vector3(0, 0.8f, 0); signalBase.transform.SetParent(playerView.transform, false); var ping = signalBase.GetComponent <PingInstance>(); ping.SetLabel(username); ping.pingType = PingType.Signal; ping.maxDist = 0.25f; ping.minDist = 2f; ping.visible = true; }
//private Vector3 FireDir = new Vector3(); void Start() { SmoothTransform = GetComponent <SmoothTransform>(); }
//List<Move> ownerMoves = new List<Move>(); void Start() { SmoothTransformKnockdown = GetComponent <SmoothTransform>(); }