38 lines
771 B
C#
38 lines
771 B
C#
using UnityEngine;
|
|
public class PC_HandModel : MonoBehaviour
|
|
{
|
|
public GameObject HandModel;
|
|
[HideInInspector]
|
|
public GameObject leftHandModel;
|
|
private void OnMouseDown()
|
|
{
|
|
SetRightHandModel(true);
|
|
SetLeftHandModel(true);
|
|
}
|
|
private void OnMouseUp()
|
|
{
|
|
SetRightHandModel(false);
|
|
SetLeftHandModel(false);
|
|
}
|
|
public void SetLeftHandModel(bool index)
|
|
{
|
|
if (leftHandModel)
|
|
{
|
|
leftHandModel.SetActive(index);
|
|
}
|
|
}
|
|
public void SetRightHandModel(bool index)
|
|
{
|
|
if (HandModel)
|
|
{
|
|
HandModel.SetActive(index);
|
|
}
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
SetRightHandModel(false);
|
|
SetLeftHandModel(false);
|
|
}
|
|
}
|