Exemple #1
0
    private void Awake()
    {
        if (!renderer) Print.NotFound<Renderer>(this);
        else if (dirtUnplowedMaterial) renderer.material = dirtUnplowedMaterial;

        collider = gameObject.GetComponentCheck<Collider>();

        Transform[] children = GetComponentsInChildren<Transform>();
        int curMid = 0;
        for (int i = 0; i < children.Length; ++i)
        {
            if (children[i].CompareTag("Fence_Mid_Section"))
            {
                fenceMidSections[curMid] = children[i].gameObject;
                if (curMid + 1 < fenceMidSections.Length) ++curMid;
            }
        }

        if (curMid < fenceMidSections.Length - 1) Print.Error(this, "Failed to find all fence mid sections: found " + curMid.ToString());
        for (int i = 0; i < fenceMidSections.Length; ++i) if (fenceMidSections[i]) fenceMidSections[i].SetActive(false);

        cropGrower = GetComponentInChildren<Crop_Grower>();
        if (!cropGrower) Print.NotFound<Crop_Grower>(this);
    }
Exemple #2
0
 private void TriggerOnCropStageFinished(Crop_Grower context, Stage stage)
 {
     if (onCropStageFinished != null) onCropStageFinished(context, stage);
 }