Tanoda
FastIKLook.cs
Go to the documentation of this file.
1
using
UnityEngine
;
2
3
namespace
DitzelGames.FastIK
4
{
5
public
class
FastIKLook
: MonoBehaviour
6
{
10
public
Transform
Target
;
11
15
protected
Vector3
StartDirection
;
16
20
protected
Quaternion
StartRotation
;
21
22
void
Awake()
23
{
24
if
(
Target
==
null
)
25
return
;
26
27
StartDirection
=
Target
.position - transform.position;
28
StartRotation
= transform.rotation;
29
}
30
31
void
Update()
32
{
33
if
(
Target
==
null
)
34
return
;
35
36
37
transform.rotation = Quaternion.FromToRotation(
StartDirection
,
Target
.position - transform.position) *
StartRotation
;
38
}
39
}
40
}
DitzelGames.FastIK.FastIKLook
Definition:
FastIKLook.cs:6
DitzelGames.FastIK.FastIKLook.StartDirection
Vector3 StartDirection
Initial direction
Definition:
FastIKLook.cs:15
DitzelGames.FastIK.FastIKLook.StartRotation
Quaternion StartRotation
Initial Rotation
Definition:
FastIKLook.cs:20
DitzelGames.FastIK.FastIKLook.Target
Transform Target
Look at target
Definition:
FastIKLook.cs:10
DitzelGames.FastIK
Definition:
FastIKDobot.cs:7
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
Scripts
FastIK
FastIKLook.cs
Generated by
1.9.3