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

@@ -11,6 +11,7 @@ namespace Assets.Scripts.InteractableObjects
bool gotItem = false;
public override void handleInteraction(GameObject player){
keepAlive = true;
if (gotItem)
{
GameObject.Find("UIHandler").GetComponent<UIHandler>().showMessage("ERROR;"+TextHandler.getText("alreadyLooted"));

View File

@@ -13,6 +13,7 @@ namespace Assets.Scripts.InteractableObjects
public override void handleInteraction(GameObject player)
{
keepAlive = true;
if (hasInteracted)
{
GameObject.Find("UIHandler").GetComponent<UIHandler>().showMessage("ERROR;"+TextHandler.getText("triedHouse"));

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

View File

@@ -8,7 +8,8 @@ namespace Assets.Scripts.InteractableObjects
{
public override void handleInteraction(GameObject player)
{
throw new System.NotImplementedException();
player.GetComponent<Animator>().SetInteger("objectCategory", 2);
player.GetComponent<Animator>().SetTrigger("Interaction");
}
}
}

View File

@@ -8,7 +8,8 @@ namespace Assets.Scripts.InteractableObjects
{
public override void handleInteraction(GameObject player)
{
throw new System.NotImplementedException();
player.GetComponent<Animator>().SetInteger("objectCategory", 2);
player.GetComponent<Animator>().SetTrigger("Interaction");
}
}
}

View File

@@ -8,7 +8,8 @@ namespace Assets.Scripts.InteractableObjects
{
public override void handleInteraction(GameObject player)
{
throw new System.NotImplementedException();
player.GetComponent<Animator>().SetInteger("objectCategory", 1);
player.GetComponent<Animator>().SetTrigger("Interaction");
}
}
}