This commit is contained in:
JA
2026-06-27 03:35:50 +08:00
parent 0bcb488b13
commit 2ab982a4e0
1044 changed files with 66627 additions and 112414 deletions

View File

@@ -0,0 +1,21 @@
using UnityEngine;
namespace IndianOceanAssets.Engine2_5D
{
// This class makes the camera follow a target transform with a specified offset.
public class CameraFollow : MonoBehaviour
{
// The target Transform that the camera will follow.
[SerializeField] private Transform target;
// The positional offset from the target.
[SerializeField] private Vector3 offset;
// Called once per frame.
private void Update()
{
// If a target is assigned, smoothly move the camera towards the target's position plus the offset.
if (target)
transform.position = Vector3.Lerp(transform.position, target.position + offset, Time.deltaTime * 8f);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: beb5f0bbc354f5d449eea8768c752e72
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: