Search Issue Tracker

Duplicate

Votes

0

Found in

5.0.0f3

Issue ID

676492

Regression

Yes

Type.GetType() in WebGL does not match the output given in the editor

WebGL

-

How to reproduce:

1. Open a new project
2. Create a script called "testGetType.cs" with the following code:

using UnityEngine;
using System;

public class RequestedClass {

}

public class testGetType : MonoBehaviour {

Type operatorType;
void Start () {
operatorType = Type.GetType("RequestedClass");
}

void OnGUI() {
GUILayout.Label ("Is the operator null? " + (operatorType == null));
GUILayout.Label ("What is the operator? " + operatorType);
}
}

3. Attach the script to any game object in the scene
4. Play the scene
- Note how the text shows that the operator type is not null, and that it is of the type RequestedClass.
5. Build to WebGL and run
- The text now shows that the operator type is null and does not return anything for the type.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.