Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class text : MonoBehaviour {
  6.  
  7. public float m_speed = 10;
  8. public float m_liveTime = 1;
  9. public float m_power = 1.0f;
  10. protected Transform m_transform;
  11.  
  12. void Start() {
  13. m_transform = this.transform;
  14. }
  15.  
  16. void Update() {
  17. m_liveTime -= Time.deltaTime;
  18. if(m_liveTime <= 0)
  19. {
  20. Destory(this.gameObject);
  21. }
  22.  
  23. m_transform.Translate(new Vector3(0, 0, -m_speed * Time.deltaTime));
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement