コード例 #1
0
ファイル: HVRStabTracker.cs プロジェクト: CeMSIM/CeMSIM-ORSim
        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);
            }
        }
コード例 #2
0
ファイル: HVRStabbable.cs プロジェクト: CeMSIM/CeMSIM-ORSim
 public virtual void OnFullStabReached(HVRStabber stabber)
 {
     FullStabbed.Invoke(stabber, this);
 }
コード例 #3
0
ファイル: HVRStabbable.cs プロジェクト: CeMSIM/CeMSIM-ORSim
 public virtual void OnStabberExit(HVRStabber stabber)
 {
     Stabbers.Remove(stabber);
     UnStabbed.Invoke(stabber, this);
 }
コード例 #4
0
ファイル: HVRStabbable.cs プロジェクト: CeMSIM/CeMSIM-ORSim
 public virtual void OnStabberEnter(HVRStabber stabber, Collision collision)
 {
     Stabbers.Add(stabber);
     Stabbed.Invoke(stabber, this, collision);
 }