Answers for "unity c# get gameobject of script"

C#
1

c# unity gameObject.script

void Update()
{
  string Thing = gameObject.GetComponent<CustomScriptName>().Variable;

  if (Thing == "String1")
  {
	DoStuff();
  }
  
    if (Thing == "String2")
  {
	DoOtherStuff();
  }
}
Posted by: Guest on December-22-2020

Code answers related to "unity c# get gameobject of script"

C# Answers by Framework

Browse Popular Code Answers by Language