Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - iron59

Pages: [1]
1
Good day. I have the following function in my code.

Code: (CSharp) [Select]
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:

Quote
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

Code: (CSharp) [Select]
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,

2
DOTween & DOTween Pro / DOPunchPosition modifies z-position
« on: July 17, 2015, 04:03:49 AM »
Good day. I have several objects that are overlapping with each other in terms of position. I'm having a problem if I use the DOPunchPosition function such that, even though I have the same z value for the object's transform position and the punch function's direction, I'm still observing that the object changes in the z-position. Here's my code:

Code: [Select]
public void PunchSprite(Vector3 sourcePos, int distance = 5) {
if(this.tweener != null) {
this.tweener.Kill(true);
}

Vector3 monstPos = this.transform.position;
float angleRad = Mathf.PI + Mathf.Atan2(sourcePos.y - monstPos.y, sourcePos.x - monstPos.x);
float targetX = Mathf.Cos(angleRad);
float targetY = Mathf.Sin(angleRad);
Vector3 targetPos = new Vector3(targetX, targetY, monstPos.z);
this.tweener = this.transform.DOPunchPosition(targetPos, 0.2f, distance, 1, false);
}

What I would like is to use the punch function without the object chaning its z-position. Any suggestions on how to fix this? Thanks in advance.

Pages: [1]