Spelunx Cavern SDK
Loading...
Searching...
No Matches
LookAt.cs
Go to the documentation of this file.
1
using
UnityEngine;
2
3
namespace
Spelunx.Vive
{
4
public
class
LookAt
:
Interaction
{
5
[SerializeField, Tooltip(
"Flip rotation. Enable this if the object is looking the opposite direction"
)]
private
bool
flipRotation =
false
;
6
7
void
Update() {
8
if
(flipRotation) {
9
transform.LookAt(2 * transform.position -
target
.position);
10
}
else
{
11
transform.LookAt(
target
);
12
}
13
}
14
}
15
}
Spelunx.Vive.Interaction
Definition:
Interaction.cs:4
Spelunx.Vive.Interaction.target
Transform target
Definition:
Interaction.cs:5
Spelunx.Vive.LookAt
Definition:
LookAt.cs:4
Spelunx.Vive
Definition:
CavernInteraction.cs:4
CavernSDK
Packages
com.spelunx.cavern.vive-trackers
Runtime
Scripts
Interactions
LookAt.cs
Generated by
1.9.6