Example #1
0
 void OnMouseDown()
 {
     Debug.Log("動く < " + pb.num + " position (x = " + pb.x + " : y = " + pb.y + ")");
     if (gc.actor [pb.num, 0] == 0 || gc.actor [pb.num, 0] == 5)
     {
         NotPro();
     }
     else if (gc.actor [pb.num, 1] != 0 && gc.actor [pb.num, 1] != 10 && (pb.y < 3 || gc.actor[pb.num, 2] < 4))                                                              //持ち駒でない&& (敵陣である || 敵陣から動く)
     {
         if ((((0 <= pb.num && pb.num < 18) || (19 <= pb.num && pb.num <= 22)) && pb.y == 0) || (23 <= pb.num && pb.num <= 26 && pb.y < 2) || ProCheck(gc.actor[pb.num, 0])) //最前線の歩・香車または上2列の桂馬・成ってる駒
         {
             Pro();                                                                                                                                                          //強制的に成る
         }
         else
         {
             var g = Instantiate(gc.nariButton, gc.guide[pb.x + pb.y * 9].transform.position - new Vector3(0, 0.18f, 1), Quaternion.identity) as GameObject;
             n = g.GetComponent <nari_back>();
         }
     }
     else             //持ち駒だったり敵陣じゃなかったり
     {
         if (ProCheck(gc.actor[pb.num, 0]))
         {
             Pro();                                           //すでに成ってたら成る
         }
         else
         {
             NotPro();              //成らない
         }
     }
 }
Example #2
0
 void OnMouseDown()
 {
     Debug.Log ("動く < "+pb.num+" position (x = "+pb.x+" : y = "+pb.y+")");
     if (gc.actor [pb.num, 0]==0||gc.actor [pb.num, 0]==5) {
         NotPro ();
     }else if (gc.actor [pb.num, 1] != 0 && gc.actor [pb.num, 1] != 10 && (pb.y < 3 || gc.actor[pb.num,2]<4)) { //持ち駒でない&& (敵陣である || 敵陣から動く)
         if((((0<=pb.num&&pb.num<18)||(19<=pb.num&&pb.num<=22))&&pb.y==0)||(23<=pb.num&&pb.num<=26&&pb.y<2)||ProCheck(gc.actor[pb.num, 0])){ //最前線の歩・香車または上2列の桂馬・成ってる駒
             Pro (); //強制的に成る
         }else{
             var g = Instantiate(gc.nariButton, gc.guide[pb.x+pb.y*9].transform.position-new Vector3(0,0.18f,1),Quaternion.identity) as GameObject;
             n = g.GetComponent<nari_back>();
         }
     } else { //持ち駒だったり敵陣じゃなかったり
         if(ProCheck(gc.actor[pb.num, 0])) Pro(); //すでに成ってたら成る
         else NotPro(); //成らない
     }
 }
Example #3
0
 // Use this for initialization
 void Start()
 {
     gc = GameObject.Find("Play_GameController").GetComponent <Play_GameController> ();
     pb = this.GetComponent <PosBox> ();
     n  = null;
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     gc = GameObject.Find ("Play_GameController").GetComponent<Play_GameController> ();
     pb = this.GetComponent<PosBox> ();
     n = null;
 }
Example #5
0
 // Use this for initialization
 void Start()
 {
     n = boss.GetComponent <nari_back> ();
 }