Skip to content

Commit

Permalink
[add] コマ反転機能と、消去を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
sumogri committed Mar 10, 2018
1 parent 50b39a7 commit 2399827
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 2 deletions.
83 changes: 81 additions & 2 deletions UnityProject/Assets/VectorShogi/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ RectTransform:
- {fileID: 397368512}
- {fileID: 1551346293}
m_Father: {fileID: 2033883617}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -2675,7 +2675,7 @@ RectTransform:
- {fileID: 732029704}
- {fileID: 293887740}
m_Father: {fileID: 2033883617}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -4711,6 +4711,84 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1911763858
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1911763859}
- component: {fileID: 1911763861}
- component: {fileID: 1911763860}
m_Layer: 5
m_Name: Adstract
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1911763859
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1911763858}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.98887515, y: 0.98887515, z: 0.98887515}
m_Children: []
m_Father: {fileID: 2033883617}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -290.56198, y: -120.2}
m_SizeDelta: {x: 160, y: 87.03}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1911763860
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1911763858}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'On Draging
- push "r" reverce koma
- push "d" delete koma'
--- !u!222 &1911763861
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1911763858}
--- !u!1 &1970943462
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -5228,6 +5306,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 866404529}
- {fileID: 1911763859}
- {fileID: 563842472}
- {fileID: 894054368}
m_Father: {fileID: 0}
Expand Down
19 changes: 19 additions & 0 deletions UnityProject/Assets/VectorShogi/koma.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ public class koma : MonoBehaviour, IDragHandler, IEndDragHandler, IBeginDragHand
private Vector3 mouseDiff;
private CanvasGroup myGroup;
private PhotonView photonView;
private bool isDraging = false;
private static Transform root = null;
private static readonly Quaternion Reverce = Quaternion.Euler(0, 0, 180);
public static Sprite initSprite = null;

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

private void Update()
{

if (Input.GetButtonDown("Reverce") && isDraging)
{
transform.rotation = transform.rotation * koma.Reverce;
}
if (Input.GetButtonDown("Destroy") && isDraging)
{
myGroup.blocksRaycasts = true;
PhotonNetwork.Destroy(this.photonView);
}

}

public void OnDrag(PointerEventData eventData)
{
var pos = Input.mousePosition;
Expand All @@ -34,6 +51,7 @@ public void OnDrag(PointerEventData eventData)
public void OnEndDrag(PointerEventData eventData)
{
myGroup.blocksRaycasts = true;
isDraging = false;
}

public void OnBeginDrag(PointerEventData eventData)
Expand All @@ -43,5 +61,6 @@ public void OnBeginDrag(PointerEventData eventData)
transform.SetAsLastSibling();
photonView.RequestOwnership();
myGroup.blocksRaycasts = false;
isDraging = true;
}
}
32 changes: 32 additions & 0 deletions UnityProject/ProjectSettings/InputManager.asset
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,35 @@ InputManager:
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Reverce
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: r
altNegativeButton:
altPositiveButton: joystick button 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Destroy
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: d
altNegativeButton:
altPositiveButton: joystick button 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
Binary file modified docs/Build/docs.asm.code.unityweb
Binary file not shown.
Binary file modified docs/Build/docs.asm.framework.unityweb
Binary file not shown.
Binary file modified docs/Build/docs.asm.memory.unityweb
Binary file not shown.
Binary file modified docs/Build/docs.data.unityweb
Binary file not shown.

0 comments on commit 2399827

Please sign in to comment.