FarmObject.activate C# (CSharp) Method

activate() public method

public activate ( ) : void
return void
    public void activate()
    {
        // Set parent to parentTransform
        transform.SetParent (parentTransform);
        // Make gameObject Active
        transform.gameObject.SetActive (true);

        // Activate children, and turn their colliders off
        foreach(Transform child in childrenTransforms)
        {
            child.GetComponent<FarmObject>().activate();
            child.GetComponent<Collider>().enabled = false;
        }
    }