Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

reference a class by string unity

using UnityEngine;
using System;

public string className;

public void AddClassToGameobject()
{
	gameObject.AddComponent(Type.GetType(className));
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: Get location in Xamarin - NAYCode.com 
Csharp :: c# string to binary 
Csharp :: get file upload file size in MB c# 
Csharp :: visual studio console.writeline not showing in output window 
Csharp :: vb.net delete folder if exists 
Csharp :: JavaScriptSerializer() and convert to base64 
Csharp :: letter to number converter c# 
Csharp :: vb.net windows version check 
Csharp :: tilemap shader 
Csharp :: c# get out of for loop 
Csharp :: c# datagridview cell align center 
Csharp :: c# 10 null checl 
Csharp :: datagridview column index 
Csharp :: c# copy all files in directory and subdirectories 
Csharp :: unity normalize 
Csharp :: show datatable c# 
Csharp :: c# for loops 
Csharp :: hashtable in c# 
Csharp :: c# textbox only numbers 
Csharp :: convert xml to json 
Csharp :: How to invoke an AWS Lambda function asynchronously 
Csharp :: c# collection of generic classes 
Csharp :: csharp compare characters 
Csharp :: blazor use static json files 
Csharp :: c# button click gets assigned the last value 
Csharp :: c# insert today datetime 
Csharp :: print bitmap company logo c sharp 
Csharp :: DisplayUnitType revit api 
Csharp :: how to list all registered users asp net 
Csharp :: Handlebars c# datetime now 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =