###前提・実現したいこと
Animatorの1つのInspectorでScriptで
「この画像で敵に当たったらシーン移動」
という風にしたいです
Animatorの切り替えは当たったら変わるようにしてあります
C#
1 void OnTriggerExit2D(Collider2D other) 2 { 3 case "Enemy": 4 if (true) 5 { 6 playerstatus--; 7 anim.SetBool("456", false); 8 } 9 if (0 < 1) 10 { 11 playerstatus--; 12 anim.SetBool("123", false); 13 } 14 break; 15}
###試したこと
Animatorは初めて使うので宣言の仕方はわかりませんが
C#
1 private Animator animator; 2 3 public void OnTriggerExit2D(Collider2D other) 4 { 5 if (other.tag == "Enemy") 6 { 7 8 Application.LoadLevel("overScene"); 9 } 10 }
を
C#
1 public void OnTriggerExit2D(Collider2D other) 2 { 3 if (other.tag == "Enemy") 4 { 5 animator.SetTrigger(other.tag == "Enemy"); 6 { 7 Application.LoadLevel("overScene"); 8 } 9 } 10 } 11//エラーのため不可
みたいに宣言したいです。。。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。