2021년 4학년 1학기 기업연계프로젝트2 컴퓨터소프트웨어공학과 <원광투어팀> 팀장 : 송유진 팀원 : 김나영, 이경희, 한유진
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

53 lines
1.8 KiB

//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Basic throwable object
//
//=============================================================================
using UnityEngine;
using UnityEngine.Events;
using System.Collections;
namespace Valve.VR.InteractionSystem
{
public class ModalThrowable : Throwable
{
[Tooltip("The local point which acts as a positional and rotational offset to use while held with a grip type grab")]
public Transform gripOffset;
[Tooltip("The local point which acts as a positional and rotational offset to use while held with a pinch type grab")]
public Transform pinchOffset;
protected override void HandHoverUpdate(Hand hand)
{
GrabTypes startingGrabType = hand.GetGrabStarting();
if (startingGrabType != GrabTypes.None)
{
if (startingGrabType == GrabTypes.Pinch)
{
hand.AttachObject(gameObject, startingGrabType, attachmentFlags, pinchOffset);
}
else if (startingGrabType == GrabTypes.Grip)
{
hand.AttachObject(gameObject, startingGrabType, attachmentFlags, gripOffset);
}
else
{
hand.AttachObject(gameObject, startingGrabType, attachmentFlags, attachmentOffset);
}
hand.HideGrabHint();
}
}
protected override void HandAttachedUpdate(Hand hand)
{
if (interactable.skeletonPoser != null)
{
interactable.skeletonPoser.SetBlendingBehaviourEnabled("PinchPose", hand.currentAttachedObjectInfo.Value.grabbedWithType == GrabTypes.Pinch);
}
base.HandAttachedUpdate(hand);
}
}
}