示例#1
0
 public void OnTriggerEnter2D(Collider2D col)
 {
     if (col.name == "Player")
     {
         if ((bluescript != null) && blueactive)
         {
             Debug.Log("BlueDown");
             blueactive = false;
             redactive  = true;
             redscript.MakeActive();
             bluescript.MakeInactive();
         }
         else
         {
             Debug.Log("Red down");
             blueactive = true;
             redactive  = false;
             redscript.MakeInactive();
             bluescript.MakeActive();
         }
     }
 }