public void UpdateIndicators(Health_Indicators h_i) { if (IndicatorsPanel != null) { IndicatorsPanel.transform.Find("H").GetComponent <RectTransform>().offsetMax = new Vector3(W * (h_i.Indicators.x / h_i.Max_Indicator.x), 0); IndicatorsPanel.transform.Find("M").GetComponent <RectTransform>().offsetMax = new Vector3(W * (h_i.Indicators.y / h_i.Max_Indicator.y), 0); IndicatorsPanel.transform.Find("S").GetComponent <RectTransform>().offsetMax = new Vector3(W * (h_i.Indicators.z / h_i.Max_Indicator.z), 0); } }
void Start() { h_i = transform.GetComponent <Health_Indicators>(); Pos = new Vector2Int(Mathf.CeilToInt(transform.position.x), Mathf.CeilToInt(transform.position.z)); if (isEnemy) { placeAttack = transform.Find("P_A").gameObject; At_An = placeAttack.GetComponent <AttactAnim>(); sprR = transform.Find("lac").Find("Render").GetComponent <SpriteRenderer>(); } }