Ejemplo n.º 1
0
    public virtual void ShowFloatingText(string text, Color color, float dTime = 1, float sSpeed = 15, float sizeMult = 1.0f)
    {
        FloatingText floatingText = GameObject.Instantiate(Resources.Load <FloatingText>("Prefabs/UI/FloatingText") as FloatingText, Position, Quaternion.identity);

        floatingText.SetOffset(Vector3.up * (Body.mAABB.HalfSize.y * 2 + 10));
        floatingText.text.characterSize              = floatingText.text.characterSize * sizeMult;
        floatingText.duration                        = dTime;
        floatingText.scrollSpeed                     = sSpeed;
        floatingText.GetComponent <TextMesh>().text  = "" + text;
        floatingText.GetComponent <TextMesh>().color = color;
    }