Added 3D player model, added better cam movement
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Assets.Scripts.Player;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Scripts.InteractableObjects
|
||||
@@ -26,8 +27,9 @@ namespace Assets.Scripts.InteractableObjects
|
||||
|
||||
public void OnInteraction(GameObject player)
|
||||
{
|
||||
StartCoroutine(playParticle(player));
|
||||
StartCoroutine(playAnimation(player));
|
||||
//StartCoroutine(playParticle(player));
|
||||
|
||||
//StartCoroutine(playAnimation(player));
|
||||
handleInteraction(player);
|
||||
}
|
||||
|
||||
@@ -53,8 +55,30 @@ namespace Assets.Scripts.InteractableObjects
|
||||
{
|
||||
if (clip != null)
|
||||
{
|
||||
Animator animator = player.GetComponent<Animator>();
|
||||
AnimationClip[] clips = animator.runtimeAnimatorController.animationClips;
|
||||
float length = 0;
|
||||
foreach (AnimationClip clip in clips)
|
||||
{
|
||||
if (clip.name.ToLower() == "disarming")
|
||||
{
|
||||
length = clip.length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (player.GetComponent<PlayerGameObject>().isArmed)
|
||||
{
|
||||
player.GetComponent<Animator>().Play("Disarming");
|
||||
yield return new WaitForSeconds(length);
|
||||
}
|
||||
player.GetComponent<Animator>().Play(clip.name);
|
||||
yield return new WaitForSeconds(clip.length);
|
||||
if (player.GetComponent<PlayerGameObject>().isArmed)
|
||||
{
|
||||
player.GetComponent<Animator>().Play("Arming");
|
||||
yield return new WaitForSeconds(length);
|
||||
}
|
||||
|
||||
}
|
||||
animationPlayed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user