예제 #1
0
    public override void PrimaryDown()
    {
        Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f));

        if (Physics.Raycast(ray, out RaycastHit hit, 10, InteractController.LayerMask))
        {
            if (hit.transform.IsChildOf(boxLock.transform) && hit.distance <= boxLock.activationRange && electricBox.isLocked())
            {
                electricBox.Unlock();
                InteractController.Instance().DeleteItem();
            }
        }
    }
예제 #2
0
파일: AllenKey.cs 프로젝트: Cxom/JimmyJam
    public override void PrimaryDown()
    {
        Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f));

        if (Physics.Raycast(ray, out RaycastHit hit, 10, InteractController.LayerMask))
        {
            if (hit.transform.IsChildOf(allenKeySlot.transform) && hit.distance <= allenKeySlot.activationRange && !waterControlCabinet.isOn())
            {
                waterControlCabinet.TurnOn();
                InteractController.Instance().DeleteItem();
            }
        }
    }
예제 #3
0
    public override void PrimaryDown()
    {
        Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f));

        if (Physics.Raycast(ray, out RaycastHit hit, 10, InteractController.LayerMask))
        {
            Ladder ladder = hit.transform.GetComponentInParent <Ladder>();
            if (ladder && hit.distance <= ladder.activationRange)
            {
                ladder.AddRungs();
                InteractController.Instance().DeleteItem();
            }
        }
    }