角色预制体创建
This commit is contained in:
68
Assets/Scripts/Configs/Mem/CameraCfg.cs
Normal file
68
Assets/Scripts/Configs/Mem/CameraCfg.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public enum CameraUpdateMode
|
||||
{
|
||||
Smooth,
|
||||
Immediate,
|
||||
}
|
||||
|
||||
public enum CameraMode
|
||||
{
|
||||
Third,
|
||||
Free,
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class CameraCfg
|
||||
{
|
||||
public CameraMode Mode;
|
||||
public CameraUpdateMode UpdateMode;
|
||||
|
||||
public float SmoothTime;
|
||||
|
||||
public float NearClipPlane = 1;
|
||||
public float FarClipPlane = 500;
|
||||
|
||||
public Vector3 Near;
|
||||
public Vector3 Far;
|
||||
public float BestRatio = 0.5f;
|
||||
|
||||
public Vector3 Distance
|
||||
{
|
||||
get { return this.Far - this.Near; }
|
||||
}
|
||||
|
||||
public Vector3 Best
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (Mode)
|
||||
{
|
||||
case CameraMode.Third:
|
||||
return this.Near + (this.Far - this.Near) * this.BestRatio;
|
||||
default:
|
||||
return Quaternion.Euler(this.PitchBest, 0, 0) *
|
||||
(Vector3.back * (this.Near + (this.Far - this.Near) * this.BestRatio).magnitude);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float Yaw;
|
||||
public bool YawAtThird;
|
||||
|
||||
public float PitchBest;
|
||||
public float PitchMin;
|
||||
public float PitchMax;
|
||||
}
|
||||
|
||||
[CreateAssetMenu(menuName = "ET/CreateCameraConfig", fileName = "CameraCfg", order = 1)]
|
||||
public class CameraScriptObject : ScriptableObject
|
||||
{
|
||||
public float ScaleTime = 6;
|
||||
public CameraCfg ThirdCfg;
|
||||
public CameraCfg FreeCfg;
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Configs/Mem/CameraCfg.cs.meta
Normal file
3
Assets/Scripts/Configs/Mem/CameraCfg.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f43c20e40ae42239e4381c12ad7cc00
|
||||
timeCreated: 1756823027
|
||||
Reference in New Issue
Block a user