/// <summary> /// Main method for processing ray cast hit /// </summary> /// <param name="hit"></param> public void ProcessRaycastHit(MatrixManager.CustomPhysicsHit hit) { if (IsHitValid(hit) == false) { return; } if (hitProcessor.ProcessHit(hit, behavioursOnBulletHit) == false) { return; } DespawnThis(hit, hit.HitWorld); }
/// <summary> /// Main method for processing ray cast hit /// </summary> /// <param name="hit"></param> public void ProcessRaycastHit(RaycastHit2D hit) { if (IsHitValid(hit) == false) { return; } if (hitProcessor.ProcessHit(hit, behavioursOnBulletHit) == false) { return; } DespawnThis(hit, hit.point); }
void OnTriggerEnter(Collider other) { if (mIsDestroyed) { return; } Fish fishFirst = other.GetComponent <Fish>();//被子弹击中的鱼 if (fishFirst == null) { Debug.LogError("Fish在这里不可能是null!"); return; } if (IsLockingFish && mTargetFish != null && mTargetFish.ID != fishFirst.ID)//锁目标 { return; } HitProcessor.ProcessHit(this, fishFirst); }