Massively reduced model sizes
This commit is contained in:
8
Assets/Scripts/Enemies/SpeedyMonster.meta
Normal file
8
Assets/Scripts/Enemies/SpeedyMonster.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eab655682b85334488b2f5513e3002d0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
45
Assets/Scripts/Enemies/SpeedyMonster/Speedy_IKTargeting.cs
Normal file
45
Assets/Scripts/Enemies/SpeedyMonster/Speedy_IKTargeting.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Speedy_IKTargeting : MonoBehaviour
|
||||
{
|
||||
protected Animator animator;
|
||||
|
||||
public bool ikActive = false;
|
||||
public Transform rightHandObj = null;
|
||||
public Transform lookObj = null;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
private void OnAnimatorIK(int layerIndex)
|
||||
{
|
||||
if(ikActive)
|
||||
{
|
||||
// Set the look target position, if one has been assigned
|
||||
if (lookObj != null)
|
||||
{
|
||||
animator.SetLookAtWeight(1);
|
||||
animator.SetLookAtPosition(lookObj.position);
|
||||
}
|
||||
|
||||
// Set the right hand target position and rotation, if one has been assigned
|
||||
if (rightHandObj != null)
|
||||
{
|
||||
animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 1);
|
||||
animator.SetIKRotationWeight(AvatarIKGoal.RightHand, 1);
|
||||
animator.SetIKPosition(AvatarIKGoal.RightHand, rightHandObj.position);
|
||||
animator.SetIKRotation(AvatarIKGoal.RightHand, rightHandObj.rotation);
|
||||
}
|
||||
} else
|
||||
{
|
||||
animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 0);
|
||||
animator.SetIKRotationWeight(AvatarIKGoal.RightHand, 0);
|
||||
animator.SetLookAtWeight(0);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8a0c0569a0425a4285afca9aac74fb5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user