Skip to content

Commit 2399827

Browse files
committed
[add] コマ反転機能と、消去を追加
1 parent 50b39a7 commit 2399827

File tree

7 files changed

+132
-2
lines changed

7 files changed

+132
-2
lines changed

UnityProject/Assets/VectorShogi/Game.unity

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ RectTransform:
19781978
- {fileID: 397368512}
19791979
- {fileID: 1551346293}
19801980
m_Father: {fileID: 2033883617}
1981-
m_RootOrder: 1
1981+
m_RootOrder: 2
19821982
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
19831983
m_AnchorMin: {x: 0.5, y: 0.5}
19841984
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -2675,7 +2675,7 @@ RectTransform:
26752675
- {fileID: 732029704}
26762676
- {fileID: 293887740}
26772677
m_Father: {fileID: 2033883617}
2678-
m_RootOrder: 2
2678+
m_RootOrder: 3
26792679
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
26802680
m_AnchorMin: {x: 0.5, y: 0.5}
26812681
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -4711,6 +4711,84 @@ Transform:
47114711
m_Father: {fileID: 0}
47124712
m_RootOrder: 0
47134713
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
4714+
--- !u!1 &1911763858
4715+
GameObject:
4716+
m_ObjectHideFlags: 0
4717+
m_PrefabParentObject: {fileID: 0}
4718+
m_PrefabInternal: {fileID: 0}
4719+
serializedVersion: 5
4720+
m_Component:
4721+
- component: {fileID: 1911763859}
4722+
- component: {fileID: 1911763861}
4723+
- component: {fileID: 1911763860}
4724+
m_Layer: 5
4725+
m_Name: Adstract
4726+
m_TagString: Untagged
4727+
m_Icon: {fileID: 0}
4728+
m_NavMeshLayer: 0
4729+
m_StaticEditorFlags: 0
4730+
m_IsActive: 1
4731+
--- !u!224 &1911763859
4732+
RectTransform:
4733+
m_ObjectHideFlags: 0
4734+
m_PrefabParentObject: {fileID: 0}
4735+
m_PrefabInternal: {fileID: 0}
4736+
m_GameObject: {fileID: 1911763858}
4737+
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
4738+
m_LocalPosition: {x: 0, y: 0, z: 0}
4739+
m_LocalScale: {x: 0.98887515, y: 0.98887515, z: 0.98887515}
4740+
m_Children: []
4741+
m_Father: {fileID: 2033883617}
4742+
m_RootOrder: 1
4743+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
4744+
m_AnchorMin: {x: 0.5, y: 0.5}
4745+
m_AnchorMax: {x: 0.5, y: 0.5}
4746+
m_AnchoredPosition: {x: -290.56198, y: -120.2}
4747+
m_SizeDelta: {x: 160, y: 87.03}
4748+
m_Pivot: {x: 0.5, y: 0.5}
4749+
--- !u!114 &1911763860
4750+
MonoBehaviour:
4751+
m_ObjectHideFlags: 0
4752+
m_PrefabParentObject: {fileID: 0}
4753+
m_PrefabInternal: {fileID: 0}
4754+
m_GameObject: {fileID: 1911763858}
4755+
m_Enabled: 1
4756+
m_EditorHideFlags: 0
4757+
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
4758+
m_Name:
4759+
m_EditorClassIdentifier:
4760+
m_Material: {fileID: 0}
4761+
m_Color: {r: 1, g: 1, b: 1, a: 1}
4762+
m_RaycastTarget: 1
4763+
m_OnCullStateChanged:
4764+
m_PersistentCalls:
4765+
m_Calls: []
4766+
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
4767+
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
4768+
m_FontData:
4769+
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
4770+
m_FontSize: 14
4771+
m_FontStyle: 0
4772+
m_BestFit: 0
4773+
m_MinSize: 10
4774+
m_MaxSize: 40
4775+
m_Alignment: 0
4776+
m_AlignByGeometry: 0
4777+
m_RichText: 1
4778+
m_HorizontalOverflow: 0
4779+
m_VerticalOverflow: 0
4780+
m_LineSpacing: 1
4781+
m_Text: 'On Draging
4782+
4783+
- push "r" reverce koma
4784+
4785+
- push "d" delete koma'
4786+
--- !u!222 &1911763861
4787+
CanvasRenderer:
4788+
m_ObjectHideFlags: 0
4789+
m_PrefabParentObject: {fileID: 0}
4790+
m_PrefabInternal: {fileID: 0}
4791+
m_GameObject: {fileID: 1911763858}
47144792
--- !u!1 &1970943462
47154793
GameObject:
47164794
m_ObjectHideFlags: 0
@@ -5228,6 +5306,7 @@ RectTransform:
52285306
m_LocalScale: {x: 0, y: 0, z: 0}
52295307
m_Children:
52305308
- {fileID: 866404529}
5309+
- {fileID: 1911763859}
52315310
- {fileID: 563842472}
52325311
- {fileID: 894054368}
52335312
m_Father: {fileID: 0}

UnityProject/Assets/VectorShogi/koma.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ public class koma : MonoBehaviour, IDragHandler, IEndDragHandler, IBeginDragHand
99
private Vector3 mouseDiff;
1010
private CanvasGroup myGroup;
1111
private PhotonView photonView;
12+
private bool isDraging = false;
1213
private static Transform root = null;
14+
private static readonly Quaternion Reverce = Quaternion.Euler(0, 0, 180);
1315
public static Sprite initSprite = null;
1416

1517
// Use this for initialization
@@ -24,6 +26,21 @@ void Start()
2426
photonView = transform.GetComponent<PhotonView>();
2527
}
2628

29+
private void Update()
30+
{
31+
32+
if (Input.GetButtonDown("Reverce") && isDraging)
33+
{
34+
transform.rotation = transform.rotation * koma.Reverce;
35+
}
36+
if (Input.GetButtonDown("Destroy") && isDraging)
37+
{
38+
myGroup.blocksRaycasts = true;
39+
PhotonNetwork.Destroy(this.photonView);
40+
}
41+
42+
}
43+
2744
public void OnDrag(PointerEventData eventData)
2845
{
2946
var pos = Input.mousePosition;
@@ -34,6 +51,7 @@ public void OnDrag(PointerEventData eventData)
3451
public void OnEndDrag(PointerEventData eventData)
3552
{
3653
myGroup.blocksRaycasts = true;
54+
isDraging = false;
3755
}
3856

3957
public void OnBeginDrag(PointerEventData eventData)
@@ -43,5 +61,6 @@ public void OnBeginDrag(PointerEventData eventData)
4361
transform.SetAsLastSibling();
4462
photonView.RequestOwnership();
4563
myGroup.blocksRaycasts = false;
64+
isDraging = true;
4665
}
4766
}

UnityProject/ProjectSettings/InputManager.asset

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,35 @@ InputManager:
293293
type: 0
294294
axis: 0
295295
joyNum: 0
296+
- serializedVersion: 3
297+
m_Name: Reverce
298+
descriptiveName:
299+
descriptiveNegativeName:
300+
negativeButton:
301+
positiveButton: r
302+
altNegativeButton:
303+
altPositiveButton: joystick button 1
304+
gravity: 1000
305+
dead: 0.001
306+
sensitivity: 1000
307+
snap: 0
308+
invert: 0
309+
type: 0
310+
axis: 0
311+
joyNum: 0
312+
- serializedVersion: 3
313+
m_Name: Destroy
314+
descriptiveName:
315+
descriptiveNegativeName:
316+
negativeButton:
317+
positiveButton: d
318+
altNegativeButton:
319+
altPositiveButton: joystick button 1
320+
gravity: 1000
321+
dead: 0.001
322+
sensitivity: 1000
323+
snap: 0
324+
invert: 0
325+
type: 0
326+
axis: 0
327+
joyNum: 0

docs/Build/docs.asm.code.unityweb

-300 Bytes
Binary file not shown.
4 Bytes
Binary file not shown.
-1.8 KB
Binary file not shown.

docs/Build/docs.data.unityweb

7.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)