public HVRStabTracker(HVRStabber stabber, HVRStabbable stabbable, HVRStabbableSettings settings, ConfigurableJoint joint, GameObject stabbedObject, Vector3 stabDirection, Transform tip, Collider[] stabbedColliders) { Stabber = stabber; Stabbable = stabbable; Settings = settings; Joint = joint; StabbedObject = stabbedObject; StabbedColliders = stabbedColliders; _stabberLength = stabber.Length; //use world in case stabber is scaled _canFullStab = true; _stabLocalPosition = Joint.connectedAnchor; _stabDirectionLocal = stabbedObject.transform.InverseTransformDirection(stabDirection); _tip = tip; _base = tip == stabber.Tip ? stabber.Base : stabber.Tip; _unstabThreshold = Stabber.Settings.UnstabThreshold; UpdateEntryAndExit(); if (Stabber.IsDualStabber || settings.CanBeImpaled || Stabber.CanRunThrough) { TryFindExitPoint(stabDirection, stabbedColliders); } }
public virtual void OnFullStabReached(HVRStabber stabber) { FullStabbed.Invoke(stabber, this); }
public virtual void OnStabberExit(HVRStabber stabber) { Stabbers.Remove(stabber); UnStabbed.Invoke(stabber, this); }
public virtual void OnStabberEnter(HVRStabber stabber, Collision collision) { Stabbers.Add(stabber); Stabbed.Invoke(stabber, this, collision); }