void Awake()
        {
            instance = this;
            thisObj  = gameObject;
            //rectT=thisObj.GetComponent<RectTransform>();
            canvasGroup = thisObj.GetComponent <CanvasGroup>();
            if (canvasGroup == null)
            {
                canvasGroup = thisObj.AddComponent <CanvasGroup>();
            }

            //rectT.localPosition=new Vector3(0, 0, 0);
        }
Beispiel #2
0
        public void SetUnit(Unit tgtUnit)
        {
            unit = tgtUnit;

            gameObject.SetActive(true);

            if (unit.isAIUnit)
            {
                sliderHP.fillRect.GetComponent <Image>().color = UIUnitOverlayManager.GetHostileHPColor();

                sliderAP.gameObject.SetActive(false);
                //line.SetActive(false);
            }
            else
            {
                sliderHP.fillRect.GetComponent <Image>().color = UIUnitOverlayManager.GetFriendlyHPColor();
                sliderAP.fillRect.GetComponent <Image>().color = UIUnitOverlayManager.GetFriendlyAPColor();
            }
        }