47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
/// <summary>
|
|
/// 发动机定速上部
|
|
/// </summary>
|
|
public class ConstantSpeedUpBtn : PermanentTriggerBase
|
|
{
|
|
public FunctionSync_PositionRoate linkageObject;
|
|
|
|
public OneValueSyncObject switchOn;
|
|
public OneValueSyncObject ConstantSpeedUp;
|
|
public FunctionSync_PositionRoate button_Rotate;
|
|
protected override void OnMDown()
|
|
{
|
|
//base.PressedEvent();
|
|
button_Rotate.transform.localEulerAngles = new Vector3(0, 0, 0);
|
|
button_Rotate.ReleaseControl();
|
|
if (switchOn.mybool)
|
|
{
|
|
ConstantSpeedUp.mybool = true;
|
|
ConstantSpeedUp.SendSync();
|
|
if (ConstantSpeedUp.action_apprisedetail != null) ConstantSpeedUp.action_apprisedetail.Invoke();
|
|
StartCoroutine(PointerRotate());
|
|
}
|
|
|
|
StepManager.Instance.FinishStep(triggerName);
|
|
}
|
|
IEnumerator PointerRotate()
|
|
{
|
|
linkageObject.GetControl();
|
|
|
|
while (linkageObject.transform.localEulerAngles.y >= 37&& linkageObject.transform.localEulerAngles.y <= 81)
|
|
{
|
|
linkageObject.transform.Rotate(0, -20 * Time.deltaTime, 0);
|
|
yield return new WaitForSecondsRealtime(0.02f);
|
|
}
|
|
linkageObject.ReleaseControl();
|
|
}
|
|
//public override void Init()
|
|
//{
|
|
|
|
|
|
//}
|
|
|
|
}
|