IEnumerator AutoDrag() { auto = true; for (float i = 0; i < autoDragTime; i += Time.deltaTime) { transform.localPosition = Vector3.Lerp(startPos, targetPos, i / autoDragTime); yield return(null); } completeAbleFeature.OnComplete(firstLock); }
internal void OnDetach() { if (rule) { rule.OnDetach(this); } completeAbleFeature.OnComplete(firstLock); }
private IEnumerator AutoRotateTo() { var target = Direction * triggerAngle + startRot.eulerAngles; var start = operater.eulerAngles; for (float timer = 0; timer < autoCompleteTime; timer += Time.deltaTime) { yield return(null); currAngle = Mathf.Lerp(0, triggerAngle, timer / autoCompleteTime); operater.eulerAngles = Vector3.Lerp(start, target, timer / autoCompleteTime); RefeshPosition(); } if (Actived) { completeFeature.OnComplete(firstLock); } }
/// <summary> /// 结束与否判断 /// </summary> public void JudgeComplete() { foreach (var item in completeDatas) { var currentItems = _currentList.FindAll(x => x.type == item.type); if (currentItems.Count == 0) { return; } float full = 0; foreach (var charge in currentItems) { full += charge.value; } if (full < item.value) { return; } } completeAbleFeature.OnComplete(lockList[0]); }
public void SetComplete() { completeAbleFeature.OnComplete(firstLock); }
protected void TriggerComplete() { completeFeature.OnComplete(firstLock); }