Example #1
0
        MarkerTypeEnum _Type; // Defines the marker type for values. Default: none

        #endregion Fields

        #region Constructors

        //  properties for the marker(s).
        internal Marker(ReportDefn r, ReportLink p, XmlNode xNode)
            : base(r, p)
        {
            _Type=MarkerTypeEnum.None;
            _Size=null;
            _Style=null;

            // Loop thru all the child nodes
            foreach(XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                    continue;
                switch (xNodeLoop.Name)
                {
                    case "Type":
                        _Type = MarkerType.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "Size":
                        _Size = new RSize(r, xNodeLoop);
                        break;
                    case "Style":
                        _Style = new Style(r, this, xNodeLoop);
                        break;
                    default:
                        break;
                }
            }
        }
Example #2
0
        Style _Style;                   // Defines the border and background style
        //  properties for the marker(s).

        internal Marker(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Type  = MarkerTypeEnum.None;
            _Size  = null;
            _Style = null;

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "Type":
                    _Type = MarkerType.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Size":
                    _Size = new RSize(r, xNodeLoop);
                    break;

                case "Style":
                    _Style = new Style(r, this, xNodeLoop);
                    break;

                default:
                    break;
                }
            }
        }
Example #3
0
    public static void CreateUiMarker(string objectname, MarkerTypeEnum type)
    {
        GameObject marker = Instantiate(UI.UImarker);

        marker.GetComponent <UiMarker>().target = GameObject.Find(objectname);
        marker.transform.SetParent(UI.transform);
        marker.transform.localScale = Vector3.one;
    }
Example #4
0
        public void MarkInNormalziedCoord(Vector2 uv, MarkerTypeEnum markerType)
        {
            var     viewport      = _targetCam.rect;
            var     posInViewport = new Vector2(uv.x * viewport.width + viewport.x, uv.y * viewport.height + viewport.y);
            var     ray           = _targetCam.ViewportPointToRay(posInViewport);
            Vector3 worldPosition;

            if (dartboard.World(ray, out worldPosition))
            {
                if ((markerType & MarkerTypeEnum.Creation) != 0)
                {
                    RpcAddCreationMarker(worldPosition);
                }
                else
                {
                    RpcAddDestructionMarker(worldPosition);
                }
            }
        }