Пример #1
0
            public void init(UIMessage mb)
            {
                this.mb = mb;

                transform.localPosition = new Vector3(0, -1f, -0.1f);

                sr        = gameObject.AddComponent <SpriteRenderer> ();
                sr.sprite = Resources.Load <Sprite> ("Sprites/UI/T_Wood");

                coll           = gameObject.AddComponent <BoxCollider2D> ();
                coll.isTrigger = true;

                textObj = new GameObject("Card Text");
                textObj.transform.parent        = transform;
                textObj.transform.localPosition = new Vector3(0, 0, -.1f);

                tm               = textObj.AddComponent <TextMesh>();
                tm.fontSize      = 168;
                tm.characterSize = 0.04f;
                tm.color         = Color.black;
                tm.alignment     = TextAlignment.Center;
                tm.anchor        = TextAnchor.MiddleCenter;
                tm.text          = "Exit";
                tm.font          = UIManager.GetFont();
                tm.GetComponent <Renderer>().material = UIManager.GetFont().material;
            }
Пример #2
0
        public static void MakeMessage(string msg)
        {
            if (_msg != null)
            {
                Destroy(_msg.gameObject);
            }

            if (gui.GetType() != typeof(GUIWorld))
            {
                Debug.Log("Can't make a message outside of World!");
                return;
            }
            UIMessage m = new GameObject("UI Message").AddComponent <UIMessage> ();

            m.init(msg);

            m.transform.parent        = gc.transform;
            m.transform.localPosition = new Vector3(-3, -1, Layer.HUD);
            //gc.SetLock (true);

            _msg = m;
        }