- Increased SFX pool size from 8 to 16 in AudioManager - Enabled preloadAudioData for multiple SFX files - Removed unused VisualScripting import from Checkpoint script - Reordered using statements in several scripts for consistency - Added CoinCollectible component to Coin prefab with pickup effects - Updated sorting layers and mesh LOD settings in Coin prefabs - Fixed typo in Interfaces.cs: optionaAttachPoint to optionalAttachPoint - Modified AddCoin method to accept count parameter and handle coin overflow - Moved projectile scripts (BasicProjectile, EnemyBasicProjectile, PhysicsProjectile, PickableProjectile) - Cleaned up unused namespaces and imports across various scripts
33 lines
750 B
C#
33 lines
750 B
C#
using Unity.Cinemachine;
|
|
using UnityEngine;
|
|
|
|
using RR.Game2D.Core.Managers;
|
|
|
|
public class CinemachineFindPlayer : MonoBehaviour
|
|
{
|
|
|
|
private GameObject _tPlayer;
|
|
private Transform _tFollowTarget;
|
|
private CinemachineCamera _virtualCamera;
|
|
|
|
void Start()
|
|
{
|
|
_virtualCamera = GetComponent<CinemachineCamera>();
|
|
|
|
if (_tPlayer != null) return;
|
|
|
|
_tPlayer = GameManager.Instance.PlayerObj;
|
|
|
|
if (_tPlayer == null) _tPlayer = GameObject.FindWithTag("Player");
|
|
|
|
}
|
|
|
|
void FixedUpdate()
|
|
{
|
|
if (_tPlayer == null) return;
|
|
|
|
_tFollowTarget = _tPlayer.transform;
|
|
_virtualCamera.LookAt = _tFollowTarget;
|
|
_virtualCamera.Follow = _tFollowTarget;
|
|
}
|
|
} |