public void OnFocusExit() { //隐藏路线 // ChessManager.GetInstant().HidenRoad(); if (current == ChessManager.GetInstant().GetFenData().player1) { GetComponent <Renderer>().material.color = Color.white; } }
public void OnFocusEnter() { //显示路线 // ChessManager.GetInstant().ShowRoad(current, new PointData(x, y, z)); if (current == ChessManager.GetInstant().GetFenData().player1) { GetComponent <Renderer>().material.color = Color.red; } }
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. }
/// <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); }
private void Update() { FenData fen = ChessManager.GetInstant().GetFenData(); if (fen.player1 == fen.current) { //什么都不干 } else { //锁定棋盘 //没完 lock游戏画面 //电脑走棋 ChessManager.GetInstant().DianNaoZouQi(); } }
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. }
public void ResetQiPan() { //锁定棋盘,电脑走棋。 ChessManager.GetInstant().ResetQiPan(); }