add 新增远程连接,实现多人游戏
This commit is contained in:
@ -35,6 +35,7 @@ public partial class ChessPiece : Sprite2D {
|
||||
if (isSelected) {
|
||||
return;
|
||||
}
|
||||
GD.Print($"{arrPos} is selected");
|
||||
this.Transform *= transToSeleted;
|
||||
this.isSelected = true;
|
||||
}
|
||||
@ -43,6 +44,7 @@ public partial class ChessPiece : Sprite2D {
|
||||
if (!isSelected) {
|
||||
return;
|
||||
}
|
||||
GD.Print($"{arrPos} is deselected");
|
||||
this.Transform *= transToSeleted.AffineInverse();
|
||||
this.isSelected = false;
|
||||
}
|
||||
@ -54,7 +56,7 @@ public partial class ChessPiece : Sprite2D {
|
||||
|
||||
private void InitLabel() {
|
||||
// this.Texture.ResourcePath = "res://Asserts/ChesspieceBase.tres";
|
||||
this.Texture = (Texture2D)ResourceLoader.Load("res://Asserts/ChesspieceBase.tres");
|
||||
this.Texture ??= (Texture2D)ResourceLoader.Load("res://Asserts/ChesspieceBase.tres");
|
||||
textureSize = this.Texture.GetSize();
|
||||
Vector2 labalPosition = new(
|
||||
-textureSize.X / 2,
|
||||
|
Reference in New Issue
Block a user