Example #1
0
    public void ShowFlyingText(string message, Color color)
    {
        GameObject flyingTextObject = Instantiate(FlyingTextPrefab) as GameObject;

        flyingTextObject.transform.SetParent(GetComponentInChildren <Canvas> ().transform);
        flyingTextObject.transform.localScale = Vector3.one * 1.5f;
        flyingTextObject.transform.position   = new Vector3(transform.position.x, transform.position.y + 0.5f, transform.position.z);
        BJFlyingText flyingText = flyingTextObject.GetComponent <BJFlyingText> ();

        flyingText.Label.color = color;
        flyingText.Label.text  = message;
    }
Example #2
0
    void ShowFlyingText(string message, Color color)
    {
        GameObject flyingTextObject = Instantiate(FlyingTextPrefab) as GameObject;

        flyingTextObject.transform.SetParent(BJGameController.Instance.BattleHud.transform);
        flyingTextObject.transform.localScale = Vector3.one;
        flyingTextObject.transform.position   = new Vector3(transform.position.x, transform.position.y + 0.5f, transform.position.z);
        BJFlyingText flyingText = flyingTextObject.GetComponent <BJFlyingText> ();

        flyingText.Label.color = color;
        flyingText.Label.text  = message;
    }