using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; public class RoateKey : PermanentTriggerBase { public StartTheEngine startTheEngine; protected int state = 0; protected override void OnMDown() { base.OnMDown(); //startTheEngine.RotateStarted(); if (state == 0) transform.DOLocalRotate(new Vector3(0, 90, 180), 2.0f).OnComplete(() => { state = 1; }); else transform.DOLocalRotate(new Vector3(0, 90, 90), 2.0f).OnComplete(() => { state = 0; }); StepManager.Instance.FinishStep(triggerName); } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } }