Пример #1
0
    void Awake()
    {
        GetComponent <CActorHealth>().EventOnSetState += OnSetState;

        Transform parentTransform = gameObject.transform.parent;

        if (parentTransform != null)
        {
            CFacilityHull parentHull = parentTransform.GetComponent <CFacilityHull>();
            if (parentHull)
            {
                SetFacilityHull(parentHull);
            }
        }

        foreach (Transform child in transform)
        {
            CHullBreachNode childBreachNode = child.GetComponent <CHullBreachNode>();
            if (childBreachNode != null)
            {
                childBreachNode.EventOnSetBreached += OnChildSetBreached;
                childBreaches.Add(childBreachNode);
            }
        }
    }
Пример #2
0
	private void SetFacilityHull(CFacilityHull facilityHull)
	{
		parentFacilityHull = facilityHull;

		foreach (Transform child in transform)
		{
			CHullBreachNode childBreachNode = child.GetComponent<CHullBreachNode>();
			if (childBreachNode != null)
				childBreachNode.SetFacilityHull(facilityHull);
		}
	}
Пример #3
0
    private void SetFacilityHull(CFacilityHull facilityHull)
    {
        parentFacilityHull = facilityHull;

        foreach (Transform child in transform)
        {
            CHullBreachNode childBreachNode = child.GetComponent <CHullBreachNode>();
            if (childBreachNode != null)
            {
                childBreachNode.SetFacilityHull(facilityHull);
            }
        }
    }