Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (current_state == PlayerCircleStates.APPEARING)
     {
         var t = (Time.time - startTime) / timeToAppear;
         if (t >= 1.0f)
         {
             current_state = PlayerCircleStates.SHOWING;
             startTime     = Time.time;
         }
         else
         {
             var newScale = Mathfx.Hermite(Vector3.zero, Vector3.one, t);
             rectTrans.localScale = newScale;
         }
     }
     else if (current_state == PlayerCircleStates.DISAPPEARING)
     {
         var t = (Time.time - startTime) / timeToAppear;
         if (t >= 1.0f)
         {
             current_state = PlayerCircleStates.NOTHING;
             startTime     = Time.time;
         }
         else
         {
             var newScale = Mathfx.Hermite(Vector3.one, Vector3.zero, t);
             rectTrans.localScale = newScale;
         }
     }
 }
Beispiel #2
0
 public void SetPlayerNumAndInitiateAnimation(int playerNum, bool check)
 {
     SetPlayerNumNoAnimation(playerNum, check);
     current_state        = PlayerCircleStates.APPEARING;
     startTime            = Time.time;
     rectTrans.localScale = Vector3.zero;
 }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     rectTrans            = GetComponent <RectTransform>();
     rectTrans.localScale = Vector3.zero;
     startTime            = Time.time;
     current_state        = PlayerCircleStates.NOTHING;
 }
Beispiel #4
0
 public void RemoveIcon()
 {
     current_state = PlayerCircleStates.DISAPPEARING;
     startTime     = Time.time;
 }