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
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
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “ValidateSchema Error2” error is thrown in the Player when using IL2CPP Scripting Backend
- Symbolic links disappear when a .xcframework file is added through the Unity Editor
- Errors regarding importing occur upon opening a project when the "Library" folder is deleted
- MeshRenderer.sortingLayerID cannot be changed when change is being done in a built Player
- Warnings related to App Icon are being thrown when building project to VisionOS Platform
This is a duplicate of issue #664765