/// <summary>
        /// Set the Panel up so it can display the text and follow the target
        /// </summary>
        /// <param name="text"> Text to display in the info box.
        /// Character limit for each line is 20 with a max of 3 lines. Anything past
        /// this point is cut off</param>
        /// <param name="objectToFollow">The object behaviour of the object being followed.
        /// The object behaviour allows the checking of parent containers.</param>
        /// <param name="followOffset">The offset in world meters from the centre of the
        /// following target</param>
        public void SetAdminOverlayPanel(string text, AdminOverlay adminOverlay,
                                         Transform objectToFollow, Vector2 followOffset)
        {
            if (objectToFollow == null)
            {
                return;
            }

            targetObjBehaviour = objectToFollow.GetComponent <ObjectBehaviour>();
            target             = objectToFollow.transform;

            cam = Camera.main;
            SetText(text);
            this.adminOverlay = adminOverlay;
            this.followOffset = followOffset;
            gameObject.SetActive(true);
        }
Beispiel #2
0
        IEnumerator WaitToSet()
        {
            yield return(WaitFor.Seconds(waitToInit));

            AdminOverlay.ServerAddInfoPanel(netId, this);
        }