Esempio n. 1
0
    public static void CreatePopup(string text, Vector3 position, Color color)
    {
        PopupText instance  = Instantiate(staticPopup);
        Vector2   screenPos = Camera.main.WorldToScreenPoint(position);

        instance.transform.SetParent(canvas.transform, false);
        instance.transform.position = position;
        instance.SetText(text);
        instance.SetColor(color);
    }
    public void QueueMessage(string message, Color color)
    {
        PopupText pop = Instantiate <PopupText>(popupText, unit.transform);

        pop.SetMessage(message);
        pop.SetColor(color);
        pop.SetOffest(new Vector3(Random.Range(-50f, 50f), 250f, 0f));
        messageQueue.Enqueue(pop);
        empty = false;
    }