Answers for "reference a class by string unity"

C#
0

reference a class by string unity

using UnityEngine;
using System;

public string className;

public void AddClassToGameobject()
{
	gameObject.AddComponent(Type.GetType(className));
}
Posted by: Guest on February-19-2021

Code answers related to "reference a class by string unity"

C# Answers by Framework

Browse Popular Code Answers by Language