UdonSharp icon indicating copy to clipboard operation
UdonSharp copied to clipboard

Explicit casting may not work.

Open ikuko opened this issue 4 years ago • 1 comments

Describe the bug in detail: It was not cast in the generated UASM even though I explicitly instructed it to cast. It is possible to work around this by going through temporary variables, but the behavior doesn't match and it feels strange.

Provide steps/code to reproduce the bug:

public class Example : UdonSharpBehaviour
{
    private void Start()
    {
        var color32 = new Color32();
        var obj = (object)color32;

        // Udon=OK C#=OK
        var arg = (Color32)obj;
        Method(arg);

        // Udon=NG C#=OK
        Method((Color32)obj);
    }

    void Method(Color color)
    {
        Debug.Log($"{color}");
    }
}

Expected behavior: Should behave the same as C#.

Additional Information: Provide any additional information here.

ikuko avatar Sep 07 '21 17:09 ikuko

This is resolved in 1.0.

MerlinVR avatar Sep 07 '21 17:09 MerlinVR