public override IEnumerator Execute(GameObject target, IAction[] actions, int index)
        {
            textdata = textObject.GetComponent <Text>();

            textdata.gameObject.SetActive(false);

            textdata.color = textcolor.GetValue(target);

            if (textObject.GetComponent <Outline>() == null)
            {
                Outline outline = textObject.AddComponent <Outline>();

                outline.effectColor = outlinecolor.GetValue(target);
                Vector2 outlineWdith = new Vector2(outlinewidth.GetValue(target), -outlinewidth.GetValue(target));
                outline.effectDistance = outlineWdith;
            }

            else
            {
                Outline outline = textObject.GetComponent <Outline>();
                outline.effectColor = outlinecolor.GetValue(target);
                Vector2 outlineWdith = new Vector2(outlinewidth.GetValue(target), -outlinewidth.GetValue(target));
                outline.effectDistance = outlineWdith;
            }

            textdata.font     = font;
            textdata.fontSize = (int)textsize.GetValue(target);

            textdata.text = this.content;

            switch (this.alignment)
            {
            case ALIGN.Left:
                textdata.alignment = TextAnchor.MiddleLeft;
                break;

            case ALIGN.Center:
                textdata.alignment = TextAnchor.MiddleCenter;
                break;

            case ALIGN.Right:
                textdata.alignment = TextAnchor.MiddleRight;
                break;
            }


            textdata.gameObject.SetActive(true);
            yield return(0);
        }
        // EXECUTABLE: ----------------------------------------------------------------------------

        public override bool InstantExecute(GameObject target, IAction[] actions, int index)
        {
            for (int i = 0; i < MapMarkers.Capacity; i++)
            {
                var gameobject = GameObject.FindGameObjectsWithTag(MapMarkers [i].Tag);
                if (gameobject != null)
                {
                    for (int a = 0; a < gameobject.Length; a++)
                    {
                        GameObject plane = GameObject.CreatePrimitive(PrimitiveType.Plane);
                        plane.name  = "MapMarkerLabel";
                        plane.layer = Layer;
                        plane.transform.localScale    = new Vector3(markerSize, markerSize, markerSize);
                        plane.transform.parent        = gameobject[a].transform;
                        plane.transform.position      = gameobject[a].transform.position + new Vector3(0, 10, 0);
                        plane.transform.localRotation = Quaternion.Euler(90, 0, 0);
                        Material material = new Material(Shader.Find("TextMeshPro/Bitmap"));


                        textMeshPro                  = plane.AddComponent <TextMeshPro>();
                        textMeshPro.fontSize         = 30;
                        textMeshPro.outlineColor     = outlinecolor.GetValue(target);
                        textMeshPro.outlineWidth     = 0.2f;
                        textMeshPro.color            = textcolor.GetValue(target);
                        textMeshPro.enableAutoSizing = true;
                        textMeshPro.alignment        = TextAlignmentOptions.Center;
                        textMeshPro.text             = MapMarkers [i].text;
                    }
                }
            }



            return(true);
        }
        public override IEnumerator Execute(GameObject target, IAction[] actions, int index)
        {
            if (textObject.GetComponent <Outline>() == null)
            {
                Outline outline = textObject.AddComponent <Outline>();

                outline.effectColor = outlinecolor.GetValue(target);
            }

            else
            {
                Outline outline = textObject.GetComponent <Outline>();
                outline.effectColor = outlinecolor.GetValue(target);
            }

            yield return(0);
        }
예제 #4
0
        private void SetAccessors(object source)
        {
            ValueProperty       = source.GetType().GetProperty(nameof(Figure.Value));
            DescribtionProperty = source.GetType().GetProperty(nameof(Figure.Describtion));
            ColorProperty       = source.GetType().GetProperty(nameof(Figure.Color));

            GetValue       = () => ValueProperty != null ? (float)ValueProperty.GetValue(_source) : 0f;
            GetDescribtion = () => DescribtionProperty != null ? (string)DescribtionProperty.GetValue(_source) : "";
            GetColor       = () => ColorProperty != null ? ((System.Drawing.Color)ColorProperty.GetValue(_source)).ToSKColor() : SKColors.LightGray;
        }
예제 #5
0
        public override IEnumerator Execute(GameObject target, IAction[] actions, int index)
        {
            textdata = textObject.GetComponent <TextMeshProUGUI>();

            textdata.gameObject.SetActive(false);


            textdata.font = font;

            Material mat = textdata.fontSharedMaterial;

            mat.shaderKeywords = new string[] { "OUTLINE_ON" };



            textdata.color = textcolor.GetValue(target);

            textdata.outlineColor = outlinecolor.GetValue(target);

            textdata.outlineWidth = outlinewidth.GetValue(target);

            textdata.fontSize = textsize.GetValue(target);

            textdata.text = this.content;


            switch (this.alignment)
            {
            case ALIGN.Left:
                textdata.alignment = TextAlignmentOptions.Left;
                break;

            case ALIGN.Center:
                textdata.alignment = TextAlignmentOptions.Center;
                break;

            case ALIGN.Right:
                textdata.alignment = TextAlignmentOptions.Right;
                break;

            case ALIGN.Justified:
                textdata.alignment = TextAlignmentOptions.Justified;
                break;
            }



            textdata.ForceMeshUpdate();
            textdata.gameObject.SetActive(true);
            yield return(0);
        }
        public override IEnumerator Execute(GameObject target, IAction[] actions, int index)
        {
            textdata = textObject.GetComponent <Text>();

            textdata.gameObject.SetActive(false);



            textdata.color = textcolor.GetValue(target);


            textdata.gameObject.SetActive(true);
            yield return(0);
        }
        public override IEnumerator Execute(GameObject target, IAction[] actions, int index)
        {
            textdata = textObject.GetComponent <TextMeshProUGUI>();

            textdata.gameObject.SetActive(false);



            Material mat = textdata.fontSharedMaterial;

            mat.shaderKeywords = new string[] { "OUTLINE_ON" };


            textdata.outlineColor = outlinecolor.GetValue(target);



            textdata.ForceMeshUpdate();
            textdata.gameObject.SetActive(true);
            yield return(0);
        }
예제 #8
0
 public bool equals(ColorProperty other)
 {
     return(this.GetValue() == other.GetValue());
 }