used_ani.cs 635 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class used_ani : MonoBehaviour
  5. {
  6. public GameObject obj;
  7. private Renderer renderer;
  8. private float tick;
  9. private float tick_a;
  10. private float tick_now;
  11. void Start()
  12. {
  13. tick = -3f;
  14. tick_a = 0.0001f;
  15. tick_now = 0;
  16. }
  17. void Update()
  18. {
  19. if (tick <= 3f)
  20. {
  21. obj.GetComponent<Renderer>().material.SetFloat("_StartPoint", tick);
  22. tick_now = tick_now + 1;
  23. tick = tick + tick_a*tick_now*tick_now/500;
  24. }
  25. }
  26. }