예제 #1
0
        void SpawnMissFloatingText(Projectile projectile)
        {
            FloatingText floatingText = SimplePool.Spawn(FloatingTextPrefab).GetComponent <FloatingText>();

            floatingText.transform.position = projectile.transform.position;
            floatingText.Color(MissColor);
            floatingText.Text("MISS");

            floatingText.StartMoving();
        }
예제 #2
0
        void SpawnFoodFloatingText(int amount, int food, Transform trans)
        {
            string mark = "";

            if (amount > 0)
            {
                mark = "+";
            }

            FloatingText floatingText = SimplePool.Spawn(FloatingTextPrefab).GetComponent <FloatingText>();

            floatingText.transform.position = trans.position;
            floatingText.Color(FoodColor);
            floatingText.Text(mark + amount);
            floatingText.Icon(FoodIconSprite, FoodColor);

            floatingText.StartMoving();
        }
예제 #3
0
        void SpawnFoodFloatingText(Unit unit)
        {
            Mob mob = unit as Mob;

            if (mob == null)
            {
                return;
            }
            if (mob.FoodReward < 1)
            {
                return;
            }

            FloatingText floatingText = SimplePool.Spawn(FloatingTextPrefab).GetComponent <FloatingText>();

            floatingText.transform.position = unit.transform.position;
            floatingText.Color(FoodColor);
            floatingText.Text("+" + mob.FoodReward);

            floatingText.StartMoving();
        }