added "finish" button to dialogue UI, implementation of many, many trinket's effects, autot-argetting fix on death, added script for particles/player following
This commit is contained in:
44
Assets/Scripts/Utils/ParticlesPlayerFollower.cs
Normal file
44
Assets/Scripts/Utils/ParticlesPlayerFollower.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Beyond
|
||||
{
|
||||
public class ParticlesPlayerFollower : MonoBehaviour
|
||||
{
|
||||
[Header("Position Settings")]
|
||||
[Tooltip("How high above the player the rain cloud sits.")]
|
||||
public float heightOffset = 15f;
|
||||
|
||||
[Tooltip("Smooths the movement so rain doesn't snap instantly.")]
|
||||
public bool useSmoothing = false;
|
||||
public float smoothSpeed = 10f;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// Auto-find Invector player if not assigned
|
||||
if (Player.Instance == null)
|
||||
{
|
||||
Debug.LogWarning("ParticlesPlayerFollower: No Player found! Make sure Player.Instance is set.");
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (Player.Instance == null) return;
|
||||
var target = Player.Instance.transform;
|
||||
// Calculate where the rain emitter should be
|
||||
// We take the player's X and Z, but override the Y with our offset
|
||||
Vector3 targetPosition = new Vector3(target.position.x, target.position.y + heightOffset, target.position.z);
|
||||
|
||||
if (useSmoothing)
|
||||
{
|
||||
transform.position = Vector3.Lerp(transform.position, targetPosition, Time.deltaTime * smoothSpeed);
|
||||
}
|
||||
else
|
||||
{
|
||||
transform.position = targetPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Utils/ParticlesPlayerFollower.cs.meta
Normal file
2
Assets/Scripts/Utils/ParticlesPlayerFollower.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e008257ca9c7464d8f9b914b5b218b6
|
||||
Reference in New Issue
Block a user