private IEnumerator ShowModelTask(string name, string motionName, bool motionLoop, string expressionName, Vector3 position, float duration) { L2DModel model = LoadModel(name); if (model == null) { yield break; } model.SetActivate(true); model.SetEyeBlinkEnabled(false); if (expressionName == "") { model.ClearExpression(true); } else { model.SetExpression(expressionName, true); } model.SetMotion(motionName, motionLoop, true); model.SetPosition(position); float startTime = Time.time; while (Time.time - (startTime + duration) < 0.0f) { float rate = (Time.time - startTime) / duration; model.SetAlpha(Mathf.Lerp(0.0f, 1.0f, rate)); yield return(null); } model.SetAlpha(1.0f); }
public override void Do() { L2DModel model = GameSystem._Instance._ModelManager.GetActiveModel(_ModelName); if (model == null) { Debug.LogError("[Command_Expression.NotExistActiveModel]" + _ModelName); return; } if (_ExpressionName == "") { model.ClearExpression(false); } else { model.SetExpression(_ExpressionName, false); } }