引擎相关玩法
This commit is contained in:
@@ -4035,15 +4035,26 @@ MonoBehaviour:
|
||||
engineConfig:
|
||||
oilRate: 0.5
|
||||
resistance: 0.1
|
||||
gearSpeed: 0.1
|
||||
speedRate: 15
|
||||
targetDuration: 2
|
||||
pullMaxSpeed: 1.2
|
||||
returnSpeed: 5
|
||||
engineData:
|
||||
config:
|
||||
oilRate: 0
|
||||
resistance: 0
|
||||
gearSpeed: 0
|
||||
speedRate: 0
|
||||
targetDuration: 0
|
||||
pullMaxSpeed: 0
|
||||
returnSpeed: 0
|
||||
curSpeed: 0
|
||||
curOil: 0
|
||||
curAcceleration: 0
|
||||
isSuccess: 0
|
||||
reachTargetTime: 0
|
||||
isAvailable: 0
|
||||
updateSpeedEvent:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace AibisDream
|
||||
{
|
||||
_isDragging = false;
|
||||
// 松手后抽回去
|
||||
var retractTime = (_initPos.y - transform.localPosition.y) / _engineSystem.engineConfig.retrunSpeed;
|
||||
var retractTime = (_initPos.y - transform.localPosition.y) / _engineSystem.engineConfig.returnSpeed;
|
||||
transform.DOMove(_initPos, retractTime);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace AibisDream
|
||||
|
||||
[Header("系统配置")] public EngineConfig engineConfig;
|
||||
[Header("系统数据")] public EngineData engineData;
|
||||
|
||||
|
||||
public bool isAvailable;
|
||||
|
||||
[HideInInspector] public UnityEvent<float> updateSpeedEvent = new();
|
||||
@@ -29,7 +29,8 @@ namespace AibisDream
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
_cordPull = transform.Find("拉绳").GetComponent<CordPull>();
|
||||
_centerGear = transform.Find("中央齿轮").GetComponent<StaticGear>();
|
||||
|
||||
_centerGear.initSpeed = engineConfig.gearSpeed;
|
||||
|
||||
// 注册相机
|
||||
var virtualCam = transform.Find("Engine Camera").GetComponentInChildren<ICinemachineCamera>();
|
||||
CameraKit.Instance.RegisterCamera(CameraEnum.Engine, virtualCam);
|
||||
@@ -59,6 +60,12 @@ namespace AibisDream
|
||||
|
||||
// 传递速度
|
||||
updateSpeedEvent.Invoke(engineData.GetRealSpeed());
|
||||
|
||||
if (engineData.CheckSuccess())
|
||||
{
|
||||
Debug.Log("引擎成功");
|
||||
DialogController.Instance?.StartDialogNode("EngineSuccess");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -81,12 +88,13 @@ namespace AibisDream
|
||||
[Serializable]
|
||||
public struct EngineConfig
|
||||
{
|
||||
public float oilRate;
|
||||
public float resistance;
|
||||
public float speedRate;
|
||||
public float targetDuration;
|
||||
public float pullMaxSpeed;
|
||||
public float retrunSpeed;
|
||||
[Header("油门倍率")] public float oilRate;
|
||||
[Header("阻力倍率")] public float resistance;
|
||||
[Header("齿轮基础速度")] public float gearSpeed;
|
||||
[Header("齿轮速度倍率")] public float speedRate;
|
||||
[Header("成功所需时间")] public float targetDuration;
|
||||
[Header("拉绳最大速度")] public float pullMaxSpeed;
|
||||
[Header("拉绳回缩速度")] public float returnSpeed;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
@@ -128,7 +136,7 @@ namespace AibisDream
|
||||
{
|
||||
reachTargetTime = 0;
|
||||
}
|
||||
|
||||
|
||||
// 如果速度达标时间足够就判断成功
|
||||
if (!(reachTargetTime >= config.targetDuration)) return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user