-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextPulse.cs
More file actions
executable file
·34 lines (26 loc) · 840 Bytes
/
TextPulse.cs
File metadata and controls
executable file
·34 lines (26 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using UnityEngine;
using System.Collections;
public class TextPulse : MonoBehaviour {
public float zEnd = 1;
public float yEnd = 1;
public float xEnd = 1;
public bool xPulse = false;
public bool yPulse = false;
public bool zPulse = true;
public float speed = 1;
Vector3 vStart;
Vector3 vEnd;
// Use this for initialization
void Start () {
if (!xPulse) xEnd = transform.localScale.x;
if (!yPulse) yEnd = transform.localScale.y;
if (!zPulse) zEnd = transform.localScale.z;
vStart = new Vector3(transform.localScale.x, transform.localScale.y, transform.localScale.z);
vEnd = new Vector3(xEnd, yEnd, zEnd);
}
// Update is called once per frame
void Update () {
//transform.localScale = Auto.Wave(1f, Vector3(1f, 1f, 0f), Vector3(1f, 1f, 1f));
transform.localScale = Auto.Wave(speed, vStart, vEnd);
}
}