Example #1
0
 private void Initialize(EnemyUnit parent)
 {
     defaultSizeDelta = GetComponent <RectTransform>().sizeDelta;
     defaultFontSize  = Count.fontSize;
     enemy            = parent;
     UpdatePositionAndScale();
     Refresh();
 }
        private void Initialize(EnemyUnit parent)
        {
            enemyUnit          = parent;
            gaugeRectTransform = HitpointGauge.GetComponent <RectTransform>();
            startOffsetMax     = gaugeRectTransform.offsetMax;
            endOffsetMax       = new Vector2(-HitpointGaugeFrame.sizeDelta.x - startOffsetMax.x, startOffsetMax.y);
            maxHitPoint        = enemyUnit.HitPoint;

            UpdatePositionAndScale();
        }
        public static UiEnemyHitPointGauge Create(EnemyUnit parent)
        {
            var gameObject = Instantiate(Resources.Load("Prefabs/Units/UiEnemyHitPointGauge")) as GameObject;
            var gauge      = gameObject.GetComponent <UiEnemyHitPointGauge>();

            StageSceneGlobalVariables.Instance.UiForegroundCanvas.AddToCanvas(gauge.gameObject);
            gauge.Initialize(parent);

            return(gauge);
        }
Example #4
0
        public static UiEnemyUnitActionWaitCount Create(EnemyUnit parent)
        {
            var gameObject = Instantiate(Resources.Load("Prefabs/Units/UiEnemyUnitActionWaitCount")) as GameObject;
            var waitCount  = gameObject.GetComponent <UiEnemyUnitActionWaitCount>();
            var canvas     = StageSceneGlobalVariables.Instance.UiForegroundCanvas;

            canvas.AddToCanvas(waitCount.gameObject);
            waitCount.Initialize(parent);

            return(waitCount);
        }