Check out example codes for "unity object bool". It will help you in understanding the concepts better.

Code Example 1

using UnityEngine;

public class Example : MonoBehaviour
{
    // check if there is a rigidbody attached to this transform
    void Start()
    {
        if (GetComponent<Rigidbody>())
        {
            Debug.Log("Rigidbody attached to this transform");
        }
    }
}

Learn ReactJs, React Native from akashmittal.com