You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Autohand.Demo
|
|
{
|
|
public class ToggleHandProjection : MonoBehaviour
|
|
{
|
|
public void DisableGripProjection()
|
|
{
|
|
var projections = AutoHandExtensions.CanFindObjectsOfType<HandProjector>(true);
|
|
|
|
foreach (var projection in projections)
|
|
{
|
|
projection.gameObject.SetActive(false);
|
|
if (projection.useGrabTransition)
|
|
projection.enabled = false;
|
|
}
|
|
}
|
|
|
|
public void EnableGripProjection()
|
|
{
|
|
var projections = AutoHandExtensions.CanFindObjectsOfType<HandProjector>(true);
|
|
foreach (var projection in projections)
|
|
{
|
|
projection.gameObject.SetActive(true);
|
|
if (projection.useGrabTransition)
|
|
projection.enabled = true;
|
|
}
|
|
}
|
|
|
|
public void DisableHighlightProjection()
|
|
{
|
|
var projections = AutoHandExtensions.CanFindObjectsOfType<HandProjector>(true);
|
|
foreach (var projection in projections)
|
|
{
|
|
projection.gameObject.SetActive(false);
|
|
if (!projection.useGrabTransition)
|
|
projection.enabled = false;
|
|
}
|
|
}
|
|
|
|
public void EnableHighlightProjection()
|
|
{
|
|
var projections = AutoHandExtensions.CanFindObjectsOfType<HandProjector>(true);
|
|
|
|
foreach (var projection in projections)
|
|
{
|
|
projection.gameObject.SetActive(true);
|
|
if (!projection.useGrabTransition)
|
|
projection.enabled = true;
|
|
}
|
|
}
|
|
}
|
|
} |