Пример #1
0
 private void ResetCreatureGrabbed()
 {
     currentTractableObject.ResetCreatureGrabbed();
     currentTractableObject     = null;
     currentlySwallowedCreature = null;
     isCreatureGrabbed          = false;
     isCreatureInsideController = false;
 }
Пример #2
0
    private void DoTriggerPressedUpdate()
    {
        //Vector3 fwd = transform.TransformDirection(Vector3.forward);


        //Debug.DrawRay(transform.position, transform.forward * rayDistance);
        if (!isCreatureGrabbed && !waitForRecharge)
        {
            Ray hittingRay = new Ray(transform.position, transform.forward);
            if (Physics.Raycast(hittingRay, out rayHitInfo, rayDistance, layerIndexIgnore))
            {
                //Debug.Log(rayHitInfo.collider.tag);
                if (rayHitInfo.collider.isTrigger && rayHitInfo.collider.tag == "Creature")
                {
                    //Debug.Log("raycast isgrabbing " + rayHitInfo.transform.name);
                    currentTractableObject = rayHitInfo.transform.GetComponent <TractableObject>();
                    InitiateCreatureGrabbed();
                }
            }
        }
    }