This commit is contained in:
2025-11-20 12:06:42 +08:00
parent 388fbe743e
commit 7936419eec
566 changed files with 130934 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: de97f9dbe07584698b8eda2275c3f015
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,25 @@
using System;
using UnityEngine;
namespace Cinemachine.Examples
{
/// <summary>
/// Simple script that makes this transform look at a target.
/// </summary>
public class BossLookAt : MonoBehaviour
{
[Tooltip("Look at this transform")]
public Transform m_LookAt;
[Tooltip("Lock the camera's X rotation to this value (in angles)")]
public float m_RotationX = 0;
[Tooltip("Lock the camera's Z rotation to this value (in angles)")]
public float m_RotationZ = 0;
void Update()
{
transform.LookAt(m_LookAt);
var euler = transform.rotation.eulerAngles;
transform.rotation = Quaternion.Euler(m_RotationX, euler.y, m_RotationZ);
}
}
}

View File

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

View File

@@ -0,0 +1,28 @@
using UnityEngine;
namespace Cinemachine.Examples
{
/// <summary>
/// An add-on module for Cinemachine Virtual Camera that locks the camera's Y co-ordinate
/// </summary>
[ExecuteAlways]
[SaveDuringPlay]
[AddComponentMenu("")] // Hide in menu
public class CustomLockCameraY : CinemachineExtension
{
[Tooltip("Lock the camera's Y position to this value")]
public float m_YPosition = 10;
protected override void PostPipelineStageCallback(
CinemachineVirtualCameraBase vcam,
CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
{
if (stage == CinemachineCore.Stage.Finalize)
{
var pos = state.RawPosition;
pos.y = m_YPosition;
state.RawPosition = pos;
}
}
}
}

View File

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