Ejemplo n.º 1
0
    public bool LBoxRay(out RaycastHit hitInfo)
    {
        Vector3 harfSize = mRayConfig.BoxcastSize / 2.0f;
        Vector3 from     = RayMethod.MakeFrom(mTransform, mRayConfig.CenterOffset);

        return(Physics.BoxCast(from, harfSize, LTo, out hitInfo, mTransform.rotation, mRayConfig.LrLength));
    }
Ejemplo n.º 2
0
 public void DrawGizmos()
 {
     Gizmos.color = Color.red;
     Gizmos.DrawRay(RayMethod.MakeFrom(mTransform, mRayConfig.RfOffset), mRFTo * mRayConfig.LRLength);
     Gizmos.DrawRay(RayMethod.MakeFrom(mTransform, mRayConfig.LfOffset), mLFTo * mRayConfig.LRLength);
     GizmosBoxcast();
 }
Ejemplo n.º 3
0
    /// <summary>正面方向ボックスレイ</summary>
    public bool ForwardBoxCast(out RaycastHit hitInfo)
    {
        Vector3 from = RayMethod.MakeFrom(mTransform, mRayConfig.ForwardOffset);
        Vector3 harf = mRayConfig.BoxSize / 2.0f;

        return(Physics.BoxCast(from, harf, mTransform.forward, out hitInfo, mTransform.rotation, mRayConfig.ForwardBoxcastLength));
    }
Ejemplo n.º 4
0
    public void GizmosBoxcast()
    {
        RaycastHit hitInfo;

        ForwardBoxCast(out hitInfo);
        Gizmos.color = Color.cyan;
        Vector3 from = RayMethod.MakeFrom(mTransform, mRayConfig.ForwardOffset);
        float   dis  = (hitInfo.distance <= 0f ? mRayConfig.ForwardBoxcastLength : hitInfo.distance);

        Gizmos.DrawWireCube((from) + (mTransform.forward * dis), mRayConfig.BoxSize);
    }
Ejemplo n.º 5
0
    public void DrawRayGizmos()
    {
        Gizmos.color = Color.red;
        if (mRayConfig == null)
        {
            return;
        }
        RaycastHit hitInfo;

        RBoxRay(out hitInfo);
        Gizmos.DrawWireCube(RayMethod.MakeFrom(mTransform, mRayConfig.CenterOffset) + (RTo * (hitInfo.distance <= 0f ? mRayConfig.LrLength : hitInfo.distance)), mRayConfig.BoxcastSize);
        LBoxRay(out hitInfo);
        Gizmos.DrawWireCube(RayMethod.MakeFrom(mTransform, mRayConfig.CenterOffset) + (LTo * (hitInfo.distance <= 0f ? mRayConfig.LrLength : hitInfo.distance)), mRayConfig.BoxcastSize);
    }
Ejemplo n.º 6
0
    /// <summary>左斜め前方向レイ</summary>
    public bool LFRaycast(out RaycastHit hitInfo)
    {
        Vector3 from = RayMethod.MakeFrom(mTransform, mRayConfig.LfOffset);

        return(Physics.Raycast(from, mLFTo, out hitInfo, mRayConfig.LRLength));
    }