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); } }
// Use this for initialization void Start() { textMesh = GetComponent<TypogenicText>(); if (textMesh != null) textMesh.Text = "" + JumpTextScript.JumpCount; else { textNorm = GetComponent<Text>(); textNorm.text = "" + JumpTextScript.JumpCount; } }
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"); }
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); } }
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); } }
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; } }
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; } }
// 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; } }
void Start() { textObject = GetComponent<TypogenicText>(); }
void Start() { textObject = GetComponent <TypogenicText>(); }
void Start() { m_killComboGUI = GetComponent<TypogenicText>(); }
public TypogenicGlyphClickEvent(TypogenicText clickSource, Vector3 clickPoint, int clickIndex) { source = clickSource; point = clickPoint; index = clickIndex; }
// Use this for initialization void Start() { typoGenic = this.GetComponent<TypogenicText>(); LoadLevelStats(); typoGenic.Text = statGrade; }
void Awake() { distanceText = transform.Find("Distance").GetComponent <TypogenicText>(); }
void Awake() { _Text = GetComponent <TypogenicText>(); _Renderer = GetComponent <MeshRenderer>(); }
public void Start() { distanceText = transform.Find("Distance").GetComponent <TypogenicText>(); coinsText = transform.Find("Coins").GetComponent <TypogenicText>(); pauseButton = transform.Find("PauseButton").gameObject; }