예제 #1
0
 void OnTriggerEnter2D(Collider2D target)
 {
     if (target.gameObject.tag == "Player")
     {
         StateChanger.RevertToDefaultState();
     }
 }
예제 #2
0
파일: tireScript.cs 프로젝트: RPWPA/GGJ
 void OnCollisionEnter2D(Collision2D colInfo)
 {
     if (colInfo.collider.gameObject.tag == "Player")
     {
         StateChanger.RevertToDefaultState();
     }
 }
예제 #3
0
 void OnCollisionEnter2D(Collision2D colInfo)
 {
     if (colInfo.collider.gameObject.tag == "Player")
     {
         //anim.SetBool("death",true);
         StateChanger.RevertToDefaultState();
     }
 }
예제 #4
0
 void CallBack(int e)
 {
     CurrentEnergy -= e;
     Text.text      = $"{Mathf.RoundToInt((CurrentEnergy / (float)MaxEnergy) * 100.0f)}%";
     if (CurrentEnergy <= 0.0f)
     {
         StateChanger.RevertToDefaultState();
     }
     else
     {
         Image.fillAmount = Mathf.RoundToInt((CurrentEnergy / (float)MaxEnergy) * 24) / 24.0f;
     }
 }
예제 #5
0
 void Watch()
 {
     while (true)
     {
         try
         {
             if (LoadAndValidate())
             {
                 StateChanger.RevertToDefaultState();
                 Text.Buffer       = string.Join("\n", attributes.Select(u => $"{u.Key}={u.Value}"));
                 Text.BufferLoaded = true;
             }
             if (IsErrored)
             {
                 IsErrored = false;
             }
         }
         catch (InvalidAttributesFileException ex)
         {
             if (!IsErrored)
             {
                 IsErrored = true;
             }
             if (ex.Message != lastError)
             {
                 lastError = ex.Message;
             }
         }
         catch (Exception ex)
         {
             Debug.LogError($"Watcher died: {ex.Message}");
         }
         finally
         {
             Thread.Sleep(1000);
         }
     }
 }