예제 #1
0
파일: HitboxMaker.cs 프로젝트: sdasd30/TSSG
    public LineHitbox createLineHB(HitScanInfo hsi)
    {
        if (ListHitboxes.Instance == null)
        {
            Debug.LogWarning("LIstHitboxes not found. Please add a Gameobject with the ListHItboxes prefab");
            return(null);
        }
        var go = GameObject.Instantiate(ListHitboxes.Instance.HitboxLine, transform.position, Quaternion.identity);

        hsi.hitCallback.Add(RegisterHit);
        LineHitbox lh = go.GetComponent <LineHitbox>();

        lh.InitFromLineInfo(hsi, gameObject, GetComponent <FactionHolder>());
        return(lh);
    }