case1
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: de97f9dbe07584698b8eda2275c3f015
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 592741a13a2c742df9e6c1d3a7d9da6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ffbed02ec61b491eb9e200d895d0fc1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user