Ejemplo n.º 1
0
 public void Activate()
 {
     if (state.Equals(CardRevealState.Inactive) && target != null)
     {
         state = CardRevealState.IsRevealing;
     }
 }
Ejemplo n.º 2
0
 private void Update()
 {
     if (state.Equals(CardRevealState.IsRevealing))
     {
         rectTrans.Rotate(0, degreesPerSecond * Time.deltaTime, 0);
         if (rectTrans.eulerAngles.y <= 90.5 && !hasSwitched)
         {
             img.texture = target;
             hasSwitched = true;
         }
         print(rectTrans.eulerAngles);
         if (hasSwitched && (rectTrans.eulerAngles.y <= 0.5 || rectTrans.eulerAngles.y >= 180))
         {
             rectTrans.eulerAngles = new Vector3(0, 0, 0);
             state = CardRevealState.IsDone;
         }
     }
 }