Ejemplo n.º 1
0
 public void OnFocusExit()
 {
     //隐藏路线
     //  ChessManager.GetInstant().HidenRoad();
     if (current == ChessManager.GetInstant().GetFenData().player1)
     {
         GetComponent <Renderer>().material.color = Color.white;
     }
 }
Ejemplo n.º 2
0
 public void OnFocusEnter()
 {
     //显示路线
     //   ChessManager.GetInstant().ShowRoad(current, new PointData(x, y, z));
     if (current == ChessManager.GetInstant().GetFenData().player1)
     {
         GetComponent <Renderer>().material.color = Color.red;
     }
 }
Ejemplo n.º 3
0
    public void OnInputClicked(InputClickedEventData eventData)
    {
        int x = int.Parse(transform.name);
        int y = int.Parse(transform.parent.name);

        ChessManager.GetInstant().CheckAndMove(new PointData(x, y));
        //隐藏路线
        ChessManager.GetInstant().HidenRoad();
        eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers.
    }
Ejemplo n.º 4
0
    /// <summary>
    /// OnSourceLost
    /// </summary>
    public void OnSourceLost(SourceStateEventData eventData)
    {
        RemoveSourceIdFromHandMap(eventData.SourceId);
        UpdateStateMachine();
        eventData.Use();

        //移动棋子
        QiziScript qiziScrip = HostTransform.GetComponent <QiziScript>();
        PointData  start     = new PointData(qiziScrip.x, qiziScrip.y, qiziScrip.z);

        ChessManager.GetInstant().CheckAndMove(start, HostTransform.position);
    }
Ejemplo n.º 5
0
    private void Update()
    {
        FenData fen = ChessManager.GetInstant().GetFenData();

        if (fen.player1 == fen.current)
        {
            //什么都不干
        }
        else
        {
            //锁定棋盘
            //没完 lock游戏画面
            //电脑走棋
            ChessManager.GetInstant().DianNaoZouQi();
        }
    }
Ejemplo n.º 6
0
 public void OnInputClicked(InputClickedEventData eventData)
 {
     if (current == ChessManager.GetInstant().GetFenData().player1)
     {
         // Increase the scale of the object just as a response.
         PointData point = new PointData(x, y, z);
         //隐藏路线
         ChessManager.GetInstant().HidenRoad();
         ChessManager.GetInstant().SetSelected(point);
         ChessManager.GetInstant().ShowRoad(current, point);
     }
     else
     {
         PointData point = new PointData(x, y, z);
         ChessManager.GetInstant().CheckAndMove(point);
     }
     eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers.
 }
Ejemplo n.º 7
0
 public void ResetQiPan()
 {
     //锁定棋盘,电脑走棋。
     ChessManager.GetInstant().ResetQiPan();
 }