Наследование: MonoBehaviour
    void OnSceneGUI()
    {
        TypogenicText src = (TypogenicText)target;

        if (src.WordWrap > 0f)
        {
            Vector3 alignmentOffset = Vector3.zero;
            if (src.Alignment == TTextAlignment.Center)
            {
                alignmentOffset = new Vector3(-src.WordWrap * 0.5f, 0f, 0f);
            }
            else if (src.Alignment == TTextAlignment.Right)
            {
                alignmentOffset = new Vector3(-src.WordWrap, 0f, 0f);
            }

            Vector3 v1 = src.transform.TransformPoint(alignmentOffset);
            Vector3 v2 = src.transform.TransformPoint(alignmentOffset + new Vector3(src.WordWrap, 0f, 0f));
            Vector3 v3 = src.transform.TransformPoint(alignmentOffset + new Vector3(0f, -src.Height, 0f));
            Vector3 v4 = src.transform.TransformPoint(alignmentOffset + new Vector3(src.WordWrap, -src.Height, 0f));

            Handles.color = Color.yellow;
            Handles.DrawLine(v1, v2);
            Handles.DrawLine(v1, v3);
            Handles.DrawLine(v4, v3);
            Handles.DrawLine(v2, v4);
        }
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        textMesh = GetComponent<TypogenicText>();

        if (textMesh != null)
            textMesh.Text = "" + JumpTextScript.JumpCount;
        else
        {
            textNorm = GetComponent<Text>();
            textNorm.text = "" + JumpTextScript.JumpCount;
        }
    }
Пример #3
0
        void Awake()
        {
            _text = gameObject.GetComponent <TypogenicText>() as TypogenicText;
            if (_text == null)
            {
                Debug.LogError("ERROR! The Typogenic_Blinking_Text was unable to associate a reference to the attached TypogenicText!", this);
            }
            startColor = _text.ColorTopLeft;

            _mat = gameObject.GetComponent <Renderer>().material;
            if (_mat == null)
            {
                Debug.LogError("ERROR! The Typogenic_Blinking_Text was unable to associate a reference to the attached TypogenicText's Material!", this);
            }
            startThickness = _mat.GetFloat("_Thickness");
        }
Пример #4
0
    void OnSceneGUI()
    {
        TypogenicText src = (TypogenicText)target;

        if (src.WordWrap > 0f)
        {
            Vector3 v1 = src.transform.position;                                          // top left
            Vector3 v2 = v1 + src.transform.rotation * new Vector3(src.WordWrap, 0f, 0f); // top right
            Vector3 v3 = v1 + src.transform.rotation * new Vector3(0f, -src.Height, 0f);  // bottom left
            Vector3 v4 = v3 + src.transform.rotation * new Vector3(src.WordWrap, 0f, 0f); // bottom right
            Handles.color = Color.yellow;
            Handles.DrawLine(v1, v2);
            Handles.DrawLine(v1, v3);
            Handles.DrawLine(v4, v3);
            Handles.DrawLine(v2, v4);
        }
    }
Пример #5
0
    public void Init(Creature obj, string damage, Color color, MovementType movementType)
    {
        m_movementType = movementType;
        m_target = obj;
        m_targetPos = obj.transform.position+m_target.HPPointTransform.localPosition;
        m_targetPos.y += 1;
        transform.position = m_targetPos;
        m_startTime = Time.time;
        m_posY = 0f;

        m_text = GetComponent<TypogenicText>();
        m_text.Text = damage;
        m_text.ColorTopLeft = color;
        //transform.localScale = Vector3.one/2f;

        if (movementType == MovementType.Parabola || movementType == MovementType.ParabolaAlpha)
        {
            float[] angs = {80,100};
            m_parabola = new Parabola(gameObject, 6f, 0f,angs[Random.Range(0, angs.Length)]*Mathf.Deg2Rad, 1);
        }
    }
Пример #6
0
    public override void BuildMesh(int page, bool front)
    {
        if (!typo)
        {
            typo = gameObject.GetComponent <TypogenicText>();
            mesh = typo.m_Mesh;
        }

        int index = page * 2;

        if (!front)
        {
            index++;
        }

        if (index < text.Count)
        {
            typo.Text = text[index];
            typo.RebuildMesh();
            mesh = typo.m_Mesh;
        }
    }
Пример #7
0
    void OnEnable()
    {
        //if (JumpCount != oldJumpCount)
        {
            if (textMesh == null)
            {
                textMesh = GetComponent<TypogenicText>();

                if (textMesh == null)
                {
                    if(textNorm == null)
                        textNorm = GetComponent<Text>();

                    textNorm.text = "" + JumpTextScript.JumpCount;
                }
            }
            else
            {
                textMesh.Text = "" + JumpTextScript.JumpCount;
            }
            //oldJumpCount = JumpCount;
        }
    }
Пример #8
0
    // Update is called once per frame
    void Update()
    {
        if (onUpdate)
        {
            if (textMesh == null)
            {
                textMesh = GetComponent<TypogenicText>();

                if (textMesh == null)
                {
                    if (textNorm == null)
                        textNorm = GetComponent<Text>();

                    textNorm.text = "" + JumpTextScript.JumpCount;
                }
            }
            else
            {
                textMesh.Text = "" + JumpTextScript.JumpCount;
            }
            //oldJumpCount = JumpCount;
        }
    }
Пример #9
0
 void Start()
 {
     textObject = GetComponent<TypogenicText>();
 }
Пример #10
0
 void Start()
 {
     textObject = GetComponent <TypogenicText>();
 }
Пример #11
0
 void Start()
 {
     m_killComboGUI = GetComponent<TypogenicText>();
 }
 public TypogenicGlyphClickEvent(TypogenicText clickSource, Vector3 clickPoint, int clickIndex)
 {
     source = clickSource;
     point  = clickPoint;
     index  = clickIndex;
 }
Пример #13
0
 // Use this for initialization
 void Start()
 {
     typoGenic = this.GetComponent<TypogenicText>();
     LoadLevelStats();
     typoGenic.Text = statGrade;
 }
Пример #14
0
 void Awake()
 {
     distanceText = transform.Find("Distance").GetComponent <TypogenicText>();
 }
Пример #15
0
 public TypogenicGlyphClickEvent(TypogenicText clickSource, Vector3 clickPoint, int clickIndex)
 {
     source = clickSource;
     point = clickPoint;
     index = clickIndex;
 }
Пример #16
0
 void Awake()
 {
     _Text     = GetComponent <TypogenicText>();
     _Renderer = GetComponent <MeshRenderer>();
 }
Пример #17
0
 public void Start()
 {
     distanceText = transform.Find("Distance").GetComponent <TypogenicText>();
     coinsText    = transform.Find("Coins").GetComponent <TypogenicText>();
     pauseButton  = transform.Find("PauseButton").gameObject;
 }