Esempio n. 1
0
        private void TextUpdate()
        {
            string str = "";

            for (int i = 0; i < displayStatusList.Count; ++i)
            {
                switch (displayStatusList[i])
                {
                case EStatus.FPS:
                {
                    float msec = Time.deltaTime * 1000.0f;
                    float fps  = 1.0f / Time.deltaTime;
                    str += string.Format("{0:0.0} ms ({1:0.} fps)", msec, fps);
                }
                break;

                case EStatus.UNIT_COUNT:
                {
                    str += "UNITS: " + Unit.unitList.Count.ToString();
                }
                break;

                case EStatus.KEY:
                {
                    str += "KEYS: [WASD], [1~3], Mouse";
                }
                break;
                }
                str += "\n";
            }

            TextDisplayer.UpdateText(gameObject, str);
        }
Esempio n. 2
0
 private void Update()
 {
     if (enableHpDisplay)
     {
         var pos = (Vector2)transform.position + new Vector2(0, 0.3f);
         TextDisplayer.UpdateText(gameObject, "HP: " + CurrentHp, pos);
     }
 }
Esempio n. 3
0
        private void Awake()
        {
            var rect = new Vector2(200f, 50f);
            var pos  = new Vector2(
                -CameraManager.WorldWidthHalf, CameraManager.WorldHeightHalf);

            var worldRect = VEasyCalc.GuiToWorldPos(rect);

            pos.x += worldRect.x * 0.5f;
            pos.y -= worldRect.y * 0.5f;

            TextDisplayer.AssignNewText(gameObject, "", new Color(1, 1, 1),
                                        pos, rect, TextAnchor.UpperLeft);
        }
Esempio n. 4
0
        private void Awake()
        {
            // TODO 에디터에서 찾게 수정
            if (owner == null)
            {
                owner = gameObject.GetComponent <Unit>();
            }
            owner.unitStatus = this;

            if (enableVitalColor && sprite == null)
            {
                sprite = GetComponent <SpriteRenderer>();
            }

            if (enableHpDisplay)
            {
                var pos = (Vector2)transform.position + new Vector2(0, 0.3f);
                TextDisplayer.AssignNewText(gameObject, "", new Color(1, 0, 0)
                                            , pos, new Vector2(50, 20), TextAnchor.MiddleCenter);
            }
        }
Esempio n. 5
0
 private void OnDisable()
 {
     TextDisplayer.RemoveText(gameObject);
 }