Added 3D player model, added better cam movement

This commit is contained in:
TAASONI3
2023-12-30 20:19:48 +01:00
parent f57389e8a4
commit 9ea4951312
49 changed files with 11586 additions and 1342 deletions

View File

@@ -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;
}