Exemplo n.º 1
0
    public static void Pop(string text, Vector3 position)
    {
        var popup = Instantiate(Instance.popupPrefab);

        WorldUI.AddedUIElement(popup.transform as RectTransform);
        WorldUI.MoveUIByWorldPosition(popup.transform, position);
        popup.Text.text = text;
    }
Exemplo n.º 2
0
    public static void Pop(string text, Vector3 position, Color color)
    {
        var popup = Instantiate(Instance.popupPrefab);

        WorldUI.AddedUIElement(popup.transform as RectTransform);
        WorldUI.MoveUIByWorldPosition(popup.transform, position);
        popup.Text.text = text;

        var alphaKeys = popup.Color.alphaKeys;
        var colorKeys = popup.Color.colorKeys;

        for (int i = 0; i < colorKeys.Length; i++)
        {
            colorKeys[i].color = color;
        }

        popup.Color.SetKeys(colorKeys, alphaKeys);
    }