using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// 发动机定速上部 /// 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() //{ //} }