Answers for "c# call a bool from another script"

C#
1

c# call a bool from another script

//class A
public class ClassA: MonoBehaviour 
{
	public bool isCounting;

	void Start() 
    {
    	isCounting = true;
  	}
}

//class B 
public class ClassB: MonoBehaviour 
{
	public ClassA cA;

	void Update()
    {
    	if(cA.isCounting )
        {
        	//do something
        }
    }
}
Posted by: Guest on July-17-2021

Code answers related to "c# call a bool from another script"

C# Answers by Framework

Browse Popular Code Answers by Language