Added tree grwoth camera animation, fixed combat camera state, fixed many errors in the console

This commit is contained in:
2024-12-28 10:28:50 +01:00
parent e75b093317
commit f59a127a4e
10 changed files with 872 additions and 831 deletions

View File

@@ -12,8 +12,8 @@ RenderTexture:
Hash: 00000000000000000000000000000000
m_IsAlphaChannelOptional: 0
serializedVersion: 6
m_Width: 2532
m_Height: 1170
m_Width: 2778
m_Height: 1284
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 0

View File

@@ -16,5 +16,5 @@ MonoBehaviour:
playmakerVersion:
showWelcomeScreen: 0
showUpgradeGuide: 0
lastAutoUpdateSignature: 6000.0.32f1__G:/PROJEKTY/BEYOND/BeyonGit/Assets__0.0.0.0
lastAutoUpdateSignature: 6000.0.31f1__/Users/marcin/projects/beyondGit/Assets__0.0.0.0
useLegacyNetworking: 0

File diff suppressed because it is too large Load Diff

View File

@@ -26,7 +26,7 @@ namespace Beyond
private void OnCombatEnd()
{
//if (wasTriggerd)
if (GameStateManager.Instance)
{
GameStateManager.Instance.OnCombatEnd(m_fsm);
// wasTriggerd = false;

View File

@@ -310,3 +310,30 @@ MonoBehaviour:
fixedAngle: {x: 0, y: 0}
lookPoints: []
cameraMode: 0
- Name: Tree
forward: -1
right: 0.13
defaultDistance: 8
maxDistance: 12
minDistance: 6
height: 2.5
smooth: 5
smoothDamp: 1
xMouseSensitivity: 4
yMouseSensitivity: 2
yMinLimit: -45
yMaxLimit: 45
xMinLimit: -360
xMaxLimit: 360
rotationOffSet: {x: 5, y: 0, z: 0}
cullingHeight: 2.31
cullingMinDist: 0.01
fov: 59.5
useZoom: 0
fixedAngle: {x: 0, y: 0}
lookPoints:
- pointName: point_01
positionPoint: {x: 0, y: 1, z: -10}
eulerAngle: {x: -0, y: 0, z: 0}
freeRotation: 0
cameraMode: 0

View File

@@ -217,7 +217,7 @@ namespace Beyond
animationName = growinAnimation;
leavesMaterials.ForEach(material => material.DOColor(initialColor, leavesColorName, 1f));
}
//Player.Instance.PlayerInput.ChangeCameraStateWithLerp("Default");
StartCoroutine(ShowFruitsCoroutine());
//animLayer = 0;
@@ -599,7 +599,7 @@ namespace Beyond
(size - startingSize));
}
}
Player.Instance.PlayerInput.ChangeCameraStateWithLerp("Default");
treeAnimator.enabled = false;
}
@@ -608,6 +608,8 @@ namespace Beyond
/// </summary>
public void GrowTree()
{
Player.Instance.PlayerInput.ChangeCameraStateWithLerp("Tree");
switch (currentTreeState)
{
case TreeState.Empty:

View File

@@ -27,7 +27,10 @@ namespace Invector.vCharacterController
[vEditorToolbar("Debug", order = 9)]
[HideInInspector]
public bool debugActionListener;
public Animator animator { get; protected set; }
public Animator animator
{ get;
protected set;
}
public bool ragdolled { get; set; }
[vEditorToolbar("Events")]

View File

@@ -85,7 +85,9 @@ namespace Invector
if (transform == null) return false;
var animator = transform.GetComponent<Animator>();
if (animator == null) return false;
var leftFoot = animator.GetBoneTransform(HumanBodyBones.LeftFoot);
Transform leftFoot = null;
if (animator.isHuman)
leftFoot = animator.GetBoneTransform(HumanBodyBones.LeftFoot);
vFootStepTrigger leftFoot_trigger = null;
if (leftFoot != null)
leftFoot_trigger = leftFoot.GetComponentInChildren<vFootStepTrigger>();
@@ -112,7 +114,9 @@ namespace Invector
collider.radius = 0.1f;
}
var rightFoot = animator.GetBoneTransform(HumanBodyBones.RightFoot);
Transform rightFoot = null;
if (animator.isHuman)
rightFoot = animator.GetBoneTransform(HumanBodyBones.RightFoot);
vFootStepTrigger rightFoot_trigger = null;
if (rightFoot != null)
rightFoot_trigger = rightFoot.GetComponentInChildren<vFootStepTrigger>();

View File

@@ -1,4 +1,5 @@
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
@@ -262,15 +263,21 @@ namespace Invector.vCharacterController.AI
protected override void OnAnimatorMove()
{
if (Time.deltaTime == 0) return;
if (!customAction && useNavMeshAgent && navMeshAgent && navMeshAgent.enabled)
{
navMeshAgent.velocity = ((animator.deltaPosition) / Time.deltaTime) * Mathf.Clamp(remainingDistanceWithoutAgent - stopingDistance, 0, 1f);
//navMeshAgent.speed = Mathf.Clamp((float)System.Math.Round((double)(animator.deltaPosition / Time.deltaTime).magnitude , 2), 0.5f, maxSpeed);
navMeshAgent.speed = Mathf.Lerp(navMeshAgent.speed, maxSpeed, aceleration * Time.deltaTime);
navMeshAgent.nextPosition = animator.rootPosition;
try {
if (Time.deltaTime == 0 || animator == null) return;
if (!customAction && useNavMeshAgent && navMeshAgent && navMeshAgent.enabled)
{
navMeshAgent.velocity = ((animator.deltaPosition) / Time.deltaTime) * Mathf.Clamp(remainingDistanceWithoutAgent - stopingDistance, 0, 1f);
//navMeshAgent.speed = Mathf.Clamp((float)System.Math.Round((double)(animator.deltaPosition / Time.deltaTime).magnitude , 2), 0.5f, maxSpeed);
navMeshAgent.speed = Mathf.Lerp(navMeshAgent.speed, maxSpeed, aceleration * Time.deltaTime);
navMeshAgent.nextPosition = animator.rootPosition;
}
}
catch (Exception e)
{
Debug.LogException(e, this);
}
base.OnAnimatorMove();
}
@@ -317,7 +324,7 @@ namespace Invector.vCharacterController.AI
_currentWaypoint = GetNearPointIndex();
else if (_randomWaypoint)
_currentWaypoint = Random.Range(0, waypoints.Count);
_currentWaypoint = UnityEngine.Random.Range(0, waypoints.Count);
else _currentWaypoint = 0;
}
@@ -325,7 +332,7 @@ namespace Invector.vCharacterController.AI
if (isWaypointStarted)
{
if (_randomWaypoint)
_currentWaypoint = Random.Range(0, waypoints.Count);
_currentWaypoint = UnityEngine.Random.Range(0, waypoints.Count);
else
_currentWaypoint++;
@@ -1066,7 +1073,7 @@ namespace Invector.vCharacterController.AI
{
var waypoints = value.GetValidPoints();
if (_randomStartingPoint)
_currentWaypoint = Random.Range(0, waypoints.Count);
_currentWaypoint = UnityEngine.Random.Range(0, waypoints.Count);
}
_waypointArea = value;
}