|
Hi, I was wondering if someone can please convert the following files into C#. I have tried to do this but am getting errors. Thanks File 1: Errors are: Assets/_Scripts/_Tile_UV_Animation/Texture_Tile_Animation.cs(34,90): error CS1502: The best overloaded method match for `UnityEngine.Vector2.Vector2(float, float)' has some invalid arguments Assets/_Scripts/_Tile_UV_Animation/Texture_Tile_Animation.cs(34,90): error CS1503: Argument //---------- Original JavaScript file:
(comments are locked)
|
Thanks for the suggestion, That-1-CraZy-BastarD. I've tried this and it gives very strange results. I have a feeling that the 'yield return new WaitForEndOfFrame()' may not be working. Is there another way to test for this, as the JavaScript version works fine?
May 09 '12 at 02:05 PM
asimov
Well, the error you posted refers to the line
May 09 '12 at 02:10 PM
Lo0NuhtiK
I found some info here that may be helpful, from the comment on http://forum.unity3d.com/threads/28766-Quick-Coroutine-amp-yield-C-question : the C# manual page does give an example (but does not explain anything): http://unity3d.com/support/documentation/ScriptReference/index.Writing_Scripts_in_Csharp.html In fact, the page even forgets to mention that C# coroutines don't work unless you explicitly use StartCoroutine() to start them. also : http://www.altdevblogaday.com/2011/07/07/unity3d-coroutines-in-detail/
May 09 '12 at 02:14 PM
alucardj
OK, well tested the script using 'yield return new WaitForSeconds(1)' and it gives the same odd results just slower. So I guess the yield statement is working meaning that the error is elsewhere. Just to provide more information, the working script simply moves through 6 sprites on a plane - the effect is a rotation of the sprite in the centre of the plane. The script that is in error doesn't keep the sprite in the middle, but moves all over the plane. Not sure if that helps any.
May 09 '12 at 02:39 PM
asimov
Maybe it's not running the same in your C# script now because your framesPerSecond variable is an int in your C# whereas it's a float in the UnityScript.
May 09 '12 at 02:42 PM
Lo0NuhtiK
(comments are locked)
|
