private void FixedUpdate() { tickCounter++; if (tickCounter < 5) { return; } snapshots.Add(Player.m_localPlayer.transform.InverseTransformPoint(VRPlayer.rightHand.transform.position)); if (snapshots.Count > MAX_SNAPSHOTS) { snapshots.RemoveAt(0); } tickCounter = 0; if (!VHVRConfig.UseSpearDirectionGraphic()) { return; } if (directionCooldown <= 0) { directionCooldown = 0; directionLine.enabled = false; } else if (!isThrowingStance) { directionCooldown -= Time.deltaTime * 5; } }
private void UpdateDirectionLine(Vector3 pos1, Vector3 pos2) { if (!VHVRConfig.UseSpearDirectionGraphic()) { return; } List <Vector3> pointList = new List <Vector3>(); pointList.Add(pos1); pointList.Add(pos2); directionLine.SetPositions(pointList.ToArray()); directionLine.enabled = true; directionCooldown = totalCooldown; }