Good day. I have the following function in my code.
IEnumerator NextStep () {
Color newCol = Color.white;
DOTween.To (()=> newCol, c => newCol = c, Color.black, 0.4f)
.OnUpdate (delegate () {
cam.backgroundColor = newCol;
logoCrystal.color = newCol;
});
yield return new WaitForSeconds (0.3f);
logo.transform.DOLocalMoveX (1f, 0.5f);
yield return new WaitForSeconds (0.2f);
logoPainting.DOColor (Color.white, 0.4f);
yield return new WaitForSeconds (0.5f);
tapText.DOColor (Color.white, 0.3f)
.OnComplete (delegate() {
tapText.DOColor (new Color (1f, 1f, 0.8f), 0.15f).SetLoops(-1, LoopType.Yoyo);
inputAllowed = true;
});
}
It throws the following error upon compilation:
Unhandled Exception: Mono.CSharp.InternalErrorException: Assets/Scripts/Utils/TitleScene.cs(65,42): ---> System.ArgumentOutOfRangeException: Argument is out of range.
at Mono.CSharp.MyBitVector.SetRange (Int32 offset, Int32 length) [0x00000] in <filename unknown>:0
at Mono.CSharp.VariableInfo.SetAssigned (Mono.CSharp.MyBitVector vector) [0x00000] in <filename unknown>:0
at Mono.CSharp.FlowBranching+UsageVector.SetAssigned (Mono.CSharp.VariableInfo var) [0x00000] in <filename unknown>:0
at Mono.CSharp.FlowBranching.SetAssigned (Mono.CSharp.VariableInfo vi) [0x00000] in <filename unknown>:0
at Mono.CSharp.VariableInfo.SetAssigned (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.LocalVariableReference.DoResolveLValue (Mono.CSharp.ResolveContext ec, Mono.CSharp.Expression right_side) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.ResolveLValue (Mono.CSharp.ResolveContext ec, Mono.CSharp.Expression right_side) [0x00000] in <filename unknown>:0
at Mono.CSharp.SimpleName.DoSimpleNameResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Expression right_side, Boolean intermediate) [0x00000] in <filename unknown>:0
at Mono.CSharp.SimpleName.SimpleNameResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Expression right_side, Boolean intermediate) [0x00000] in <filename unknown>:0
at Mono.CSharp.SimpleName.DoResolveLValue (Mono.CSharp.ResolveContext ec, Mono.CSharp.Expression right_side) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.ResolveLValue (Mono.CSharp.ResolveContext ec, Mono.CSharp.Expression right_side) [0x00000] in <filename unknown>:0
at Mono.CSharp.Assign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.SimpleAssign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.ContextualReturn.DoResolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.ExitStatement.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Mono.CSharp.AnonymousMethodExpression.Compatible (Mono.CSharp.ResolveContext ec, System.Type type) [0x00000] in <filename unknown>:0
at Mono.CSharp.AnonymousMethodExpression.ImplicitStandardConversionExists (Mono.CSharp.ResolveContext ec, System.Type delegate_type) [0x00000] in <filename unknown>:0
at Mono.CSharp.Convert.ImplicitConversionExists (Mono.CSharp.ResolveContext ec, Mono.CSharp.Expression expr, System.Type target_type) [0x00000] in <filename unknown>:0
at Mono.CSharp.MethodGroupExpr.IsArgumentCompatible (Mono.CSharp.ResolveContext ec, Modifier arg_mod, Mono.CSharp.Argument argument, Modifier param_mod, System.Type parameter) [0x00000] in <filename unknown>:0
at Mono.CSharp.MethodGroupExpr.IsApplicable (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& arguments, Int32 arg_count, System.Reflection.MethodBase& method, System.Boolean& params_expanded_form) [0x00000] in <filename unknown>:0
at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0
at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0
at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Expression right_side) [0x00000] in <filename unknown>:0
at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0
at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.IteratorStatement.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0
Line 65 corresponds to the first DOTween call in my snippet. Further more, adding
yield return new WaitForSeconds (0f);
will resolve the error.
I searched for any similar cases, but the closest I found would be the InternalErrorException caused by named parameters which is no the case in my code. Any ideas on this? Thank you very much,