Sfoglia il codice sorgente

push notifications

Axel Nordh 6 anni fa
parent
commit
aaa002f1f8

+ 4 - 4
Assets/MainMenu.unity

@@ -2607,7 +2607,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 1, y: 1}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: -0.000045776367, y: 18.181007}
+  m_AnchoredPosition: {x: -0.000045776367, y: 18.36348}
   m_SizeDelta: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 1}
   m_Pivot: {x: 0.5, y: 1}
 --- !u!114 &321314050
 --- !u!114 &321314050
@@ -5560,7 +5560,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 1, y: 1}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: -0.000015258789, y: 18.181007}
+  m_AnchoredPosition: {x: -0.000015258789, y: 18.36348}
   m_SizeDelta: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 1}
   m_Pivot: {x: 0.5, y: 1}
 --- !u!114 &777178507
 --- !u!114 &777178507
@@ -8435,7 +8435,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 0, y: 18.180979}
+  m_AnchoredPosition: {x: 0, y: 18.363462}
   m_SizeDelta: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0, y: 1}
   m_Pivot: {x: 0, y: 1}
 --- !u!114 &1273003562
 --- !u!114 &1273003562
@@ -12149,7 +12149,7 @@ MonoBehaviour:
   m_HandleRect: {fileID: 974731452}
   m_HandleRect: {fileID: 974731452}
   m_Direction: 2
   m_Direction: 2
   m_Value: 0
   m_Value: 0
-  m_Size: 0.8798521
+  m_Size: 0.87985224
   m_NumberOfSteps: 0
   m_NumberOfSteps: 0
   m_OnValueChanged:
   m_OnValueChanged:
     m_PersistentCalls:
     m_PersistentCalls:

+ 8 - 0
Assets/Material.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7a660c883c73b154492f79e87f8cb28e
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 77 - 0
Assets/Material/Plastic.mat

@@ -0,0 +1,77 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Plastic
+  m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
+  m_ShaderKeywords: 
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Floats:
+    - _BumpScale: 1
+    - _Cutoff: 0.5
+    - _DetailNormalMapScale: 1
+    - _DstBlend: 0
+    - _GlossMapScale: 1
+    - _Glossiness: 0.8
+    - _GlossyReflections: 1
+    - _Metallic: 0
+    - _Mode: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _UVSec: 0
+    - _ZWrite: 1
+    m_Colors:
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

+ 8 - 0
Assets/Material/Plastic.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 21b0b4d6b30cb19438cd65eec9394c06
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 0
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 94 - 21
Assets/Prefab/NewQuestion.prefab

@@ -15,6 +15,7 @@ GameObject:
   - component: {fileID: 7776552258544191885}
   - component: {fileID: 7776552258544191885}
   - component: {fileID: 7933561225938041952}
   - component: {fileID: 7933561225938041952}
   - component: {fileID: 4763204001755850318}
   - component: {fileID: 4763204001755850318}
+  - component: {fileID: 8353084042501626580}
   m_Layer: 5
   m_Layer: 5
   m_Name: NewQuestion
   m_Name: NewQuestion
   m_TagString: Untagged
   m_TagString: Untagged
@@ -29,7 +30,7 @@ RectTransform:
   m_PrefabInstance: {fileID: 0}
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 4662818861115959987}
   m_GameObject: {fileID: 4662818861115959987}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: -1}
   m_LocalPosition: {x: 0, y: 0, z: -1}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
   m_Children:
@@ -60,7 +61,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 4662818861115959987}
   m_GameObject: {fileID: 4662818861115959987}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
   m_Material: {fileID: 0}
@@ -69,8 +70,6 @@ MonoBehaviour:
   m_OnCullStateChanged:
   m_OnCullStateChanged:
     m_PersistentCalls:
     m_PersistentCalls:
       m_Calls: []
       m_Calls: []
-    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
-      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
   m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
   m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
   m_Type: 1
   m_Type: 1
   m_PreserveAspect: 0
   m_PreserveAspect: 0
@@ -80,6 +79,7 @@ MonoBehaviour:
   m_FillClockwise: 1
   m_FillClockwise: 1
   m_FillOrigin: 0
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
   m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
 --- !u!114 &8491633767315704838
 --- !u!114 &8491633767315704838
 MonoBehaviour:
 MonoBehaviour:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -89,7 +89,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 4662818861115959987}
   m_GameObject: {fileID: 4662818861115959987}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_Padding:
   m_Padding:
@@ -159,6 +159,45 @@ CanvasGroup:
   m_Interactable: 1
   m_Interactable: 1
   m_BlocksRaycasts: 1
   m_BlocksRaycasts: 1
   m_IgnoreParentGroups: 0
   m_IgnoreParentGroups: 0
+--- !u!23 &8353084042501626580
+MeshRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4662818861115959987}
+  m_Enabled: 1
+  m_CastShadows: 1
+  m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 2
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 2100000, guid: 21b0b4d6b30cb19438cd65eec9394c06, type: 2}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 3
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
 --- !u!1 &5145380995516278083
 --- !u!1 &5145380995516278083
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -172,6 +211,7 @@ GameObject:
   - component: {fileID: 5145380995516278111}
   - component: {fileID: 5145380995516278111}
   - component: {fileID: 5145380995516278110}
   - component: {fileID: 5145380995516278110}
   - component: {fileID: 5145380995516278081}
   - component: {fileID: 5145380995516278081}
+  - component: {fileID: 1478543147568931401}
   m_Layer: 5
   m_Layer: 5
   m_Name: QuestionPanel
   m_Name: QuestionPanel
   m_TagString: Untagged
   m_TagString: Untagged
@@ -216,7 +256,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 5145380995516278083}
   m_GameObject: {fileID: 5145380995516278083}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
   m_Material: {fileID: 0}
@@ -225,8 +265,6 @@ MonoBehaviour:
   m_OnCullStateChanged:
   m_OnCullStateChanged:
     m_PersistentCalls:
     m_PersistentCalls:
       m_Calls: []
       m_Calls: []
-    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
-      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
   m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
   m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
   m_Type: 1
   m_Type: 1
   m_PreserveAspect: 0
   m_PreserveAspect: 0
@@ -236,6 +274,7 @@ MonoBehaviour:
   m_FillClockwise: 1
   m_FillClockwise: 1
   m_FillOrigin: 0
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
   m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
 --- !u!114 &5145380995516278110
 --- !u!114 &5145380995516278110
 MonoBehaviour:
 MonoBehaviour:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -245,7 +284,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 5145380995516278083}
   m_GameObject: {fileID: 5145380995516278083}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_IgnoreLayout: 0
   m_IgnoreLayout: 0
@@ -265,12 +304,51 @@ MonoBehaviour:
   m_GameObject: {fileID: 5145380995516278083}
   m_GameObject: {fileID: 5145380995516278083}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: 1573420865, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
   m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
   m_EffectDistance: {x: 1, y: -1}
   m_EffectDistance: {x: 1, y: -1}
   m_UseGraphicAlpha: 1
   m_UseGraphicAlpha: 1
+--- !u!23 &1478543147568931401
+MeshRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 5145380995516278083}
+  m_Enabled: 1
+  m_CastShadows: 1
+  m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 2
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 2100000, guid: 21b0b4d6b30cb19438cd65eec9394c06, type: 2}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 3
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
 --- !u!1 &5145380996076868375
 --- !u!1 &5145380996076868375
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -328,7 +406,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 5145380996076868375}
   m_GameObject: {fileID: 5145380996076868375}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
   m_Material: {fileID: 0}
@@ -337,8 +415,6 @@ MonoBehaviour:
   m_OnCullStateChanged:
   m_OnCullStateChanged:
     m_PersistentCalls:
     m_PersistentCalls:
       m_Calls: []
       m_Calls: []
-    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
-      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
   m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
   m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
   m_Type: 1
   m_Type: 1
   m_PreserveAspect: 0
   m_PreserveAspect: 0
@@ -348,6 +424,7 @@ MonoBehaviour:
   m_FillClockwise: 1
   m_FillClockwise: 1
   m_FillOrigin: 0
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
   m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
 --- !u!114 &5145380996076868370
 --- !u!114 &5145380996076868370
 MonoBehaviour:
 MonoBehaviour:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -357,7 +434,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 5145380996076868375}
   m_GameObject: {fileID: 5145380996076868375}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_IgnoreLayout: 0
   m_IgnoreLayout: 0
@@ -377,7 +454,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 5145380996076868375}
   m_GameObject: {fileID: 5145380996076868375}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: 1573420865, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
   m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
@@ -437,7 +514,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 5145380997204476519}
   m_GameObject: {fileID: 5145380997204476519}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
   m_Material: {fileID: 0}
@@ -446,8 +523,6 @@ MonoBehaviour:
   m_OnCullStateChanged:
   m_OnCullStateChanged:
     m_PersistentCalls:
     m_PersistentCalls:
       m_Calls: []
       m_Calls: []
-    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
-      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
   m_FontData:
   m_FontData:
     m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
     m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
     m_FontSize: 16
     m_FontSize: 16
@@ -516,7 +591,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 5145380997340698413}
   m_GameObject: {fileID: 5145380997340698413}
   m_Enabled: 1
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_EditorHideFlags: 0
-  m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
   m_Name: 
   m_Name: 
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
   m_Material: {fileID: 0}
@@ -525,8 +600,6 @@ MonoBehaviour:
   m_OnCullStateChanged:
   m_OnCullStateChanged:
     m_PersistentCalls:
     m_PersistentCalls:
       m_Calls: []
       m_Calls: []
-    m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
-      Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
   m_FontData:
   m_FontData:
     m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
     m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
     m_FontSize: 14
     m_FontSize: 14

+ 0 - 22
Assets/Scripts/Database/OnlineDatabase.cs

@@ -10,10 +10,8 @@ using System.IO;
 public class OnlineDatabase : MonoBehaviour {
 public class OnlineDatabase : MonoBehaviour {
     private const string onlineQuestionsUrl = "nordh.xyz/narKampen/dbFiles/Question.php";
     private const string onlineQuestionsUrl = "nordh.xyz/narKampen/dbFiles/Question.php";
     private const string serverUrl = "nordh.xyz/narKampen/dbFiles/";
     private const string serverUrl = "nordh.xyz/narKampen/dbFiles/";
-    string databaseUrl;
     string gameMode;
     string gameMode;
     int winAmount = -1;
     int winAmount = -1;
-    int questionTimer = -1;
 
 
     public GameObject questionCardPrefab;
     public GameObject questionCardPrefab;
 
 
@@ -186,8 +184,6 @@ public class OnlineDatabase : MonoBehaviour {
     string answerString = "";
     string answerString = "";
     string idString = "";
     string idString = "";
     string categoryString = "";
     string categoryString = "";
-    private int round = -1;
-    private string SearchString;
 
 
     public string QuestionString { get => questionString; set => questionString = value; }
     public string QuestionString { get => questionString; set => questionString = value; }
 
 
@@ -464,24 +460,6 @@ public class OnlineDatabase : MonoBehaviour {
         return questionsLost;
         return questionsLost;
     }
     }
 
 
-    public string GetGameMode(int gameId) {
-        if (this.gameMode == null) {
-            string sql = "SELECT gameMode FROM game WHERE id = " + gameId;
-            IDbConnection conn = new SqliteConnection(databaseUrl);
-            conn.Open();
-            IDbCommand cmd = conn.CreateCommand();
-            cmd.CommandText = sql;
-            IDataReader reader = cmd.ExecuteReader();
-            while (reader.Read()) {
-                this.gameMode = reader.GetString(0);
-            }
-            reader.Close();
-            cmd.Dispose();
-            conn.Close();
-        }
-        return this.gameMode;
-    }
-
     internal int GetWinCondition(int gameId) {
     internal int GetWinCondition(int gameId) {
         if (winAmount == -1) {
         if (winAmount == -1) {
             WWWForm form = new WWWForm();
             WWWForm form = new WWWForm();

+ 0 - 1
Assets/Scripts/MainMenu.cs

@@ -24,7 +24,6 @@ public class MainMenu : MonoBehaviour {
     public GameObject finishedGamePrefab;
     public GameObject finishedGamePrefab;
 
 
     private int loggedInUserId;
     private int loggedInUserId;
-    private readonly string gamesPostUrl = "nordh.xyz/narKampen/dbFiles/Games.php?";
 
 
     private void Start() {
     private void Start() {
         startNewGameButton.onClick.AddListener(StartNewGameAction);
         startNewGameButton.onClick.AddListener(StartNewGameAction);

BIN
Assets/narKampenLocal.db


+ 8 - 0
dbFiles/OnlineGames.php

@@ -140,6 +140,14 @@
 		if (!$result) {
 		if (!$result) {
 			echo "Failed to update current player for game with id $gameId - error: " . $conn->error;
 			echo "Failed to update current player for game with id $gameId - error: " . $conn->error;
 		}
 		}
+		
+		$sql = "SELECT deviceId FROM users WHERE username = '$currentPlayer'";
+		$result = $conn->query($sql);
+		$data = $result->fetch_assoc();
+		require_once("SendToDevice.php");
+		$std = new SendToDevice();
+		$std->SendYourTurnMessage($data['deviceId']);
+		
 	} else if ($callFunction === "GetPlayerPoints") {
 	} else if ($callFunction === "GetPlayerPoints") {
 		$sql = "SELECT userLockedQuestions FROM game WHERE gameId = $gameId AND playerId = (SELECT id FROM users WHERE name = '$userName')";
 		$sql = "SELECT userLockedQuestions FROM game WHERE gameId = $gameId AND playerId = (SELECT id FROM users WHERE name = '$userName')";
 		$result = $conn->query($sql);
 		$result = $conn->query($sql);

+ 139 - 0
dbFiles/PushNotifications.php

@@ -0,0 +1,139 @@
+
+<?php 
+// Server file
+class PushNotifications {
+	// (Android)API access key from Google API's Console.
+	private static $API_ACCESS_KEY = 'AIzaSyAXstfwpQbLarzZPRO8MXwHx31TSly5QQ4';
+	// (iOS) Private key's passphrase.
+	private static $passphrase = 'nottset';
+	// (Windows Phone 8) The name of our push channel.
+        private static $channelName = "notset";
+	
+	// Change the above three vriables as per your app.
+	public function __construct() {
+		exit('Init function is not allowed');
+	}
+	
+        // Sends Push notification for Android users
+	public function android($data, $reg_id) {
+	        $url = 'https://android.googleapis.com/gcm/send';
+	        $message = array(
+	            'title' => $data['mtitle'],
+	            'message' => $data['mdesc'],
+	            'subtitle' => '',
+	            'tickerText' => '',
+	            'msgcnt' => 1,
+	            'vibrate' => 1
+	        );
+	        
+	        $headers = array(
+	        	'Authorization: key=' .self::$API_ACCESS_KEY,
+	        	'Content-Type: application/json'
+	        );
+	
+	        $fields = array(
+	            'registration_ids' => array($reg_id),
+	            'data' => $message,
+	        );
+	
+	    	return $this->useCurl($url, $headers, json_encode($fields));
+    	}
+	
+	// Sends Push's toast notification for Windows Phone 8 users
+	public function WP($data, $uri) {
+		$delay = 2;
+		$msg =  "<?xml version=\"1.0\" encoding=\"utf-8\"?>" .
+		        "<wp:Notification xmlns:wp=\"WPNotification\">" .
+		            "<wp:Toast>" .
+		                "<wp:Text1>".htmlspecialchars($data['mtitle'])."</wp:Text1>" .
+		                "<wp:Text2>".htmlspecialchars($data['mdesc'])."</wp:Text2>" .
+		            "</wp:Toast>" .
+		        "</wp:Notification>";
+		
+		$sendedheaders =  array(
+		    'Content-Type: text/xml',
+		    'Accept: application/*',
+		    'X-WindowsPhone-Target: toast',
+		    "X-NotificationClass: $delay"
+		);
+		
+		$response = $this->useCurl($uri, $sendedheaders, $msg);
+		
+		$result = array();
+		foreach(explode("\n", $response) as $line) {
+		    $tab = explode(":", $line, 2);
+		    if (count($tab) == 2)
+		        $result[$tab[0]] = trim($tab[1]);
+		}
+		
+		return $result;
+	}
+	
+        // Sends Push notification for iOS users
+	public function iOS($data, $devicetoken) {
+		$deviceToken = $devicetoken;
+		$ctx = stream_context_create();
+		// ck.pem is your certificate file
+		stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem');
+		stream_context_set_option($ctx, 'ssl', 'passphrase', self::$passphrase);
+		// Open a connection to the APNS server
+		$fp = stream_socket_client(
+			'ssl://gateway.sandbox.push.apple.com:2195', $err,
+			$errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
+		if (!$fp)
+			exit("Failed to connect: $err $errstr" . PHP_EOL);
+		// Create the payload body
+		$body['aps'] = array(
+			'alert' => array(
+			    'title' => $data['mtitle'],
+                'body' => $data['mdesc'],
+			 ),
+			'sound' => 'default'
+		);
+		// Encode the payload as JSON
+		$payload = json_encode($body);
+		// Build the binary notification
+		$msg = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload;
+		// Send it to the server
+		$result = fwrite($fp, $msg, strlen($msg));
+		
+		// Close the connection to the server
+		fclose($fp);
+		if (!$result)
+			return 'Message not delivered' . PHP_EOL;
+		else
+			return 'Message successfully delivered' . PHP_EOL;
+	}
+	
+	// Curl 
+	private function useCurl(&$model, $url, $headers, $fields = null) {
+	        // Open connection
+	        $ch = curl_init();
+	        if ($url) {
+	            // Set the url, number of POST vars, POST data
+	            curl_setopt($ch, CURLOPT_URL, $url);
+	            curl_setopt($ch, CURLOPT_POST, true);
+	            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+	            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+	     
+	            // Disabling SSL Certificate support temporarly
+	            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+	            if ($fields) {
+	                curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
+	            }
+	     
+	            // Execute post
+	            $result = curl_exec($ch);
+	            if ($result === FALSE) {
+	                die('Curl failed: ' . curl_error($ch));
+	            }
+	     
+	            // Close connection
+	            curl_close($ch);
+	
+	            return $result;
+        }
+    }
+    
+}
+?>

+ 22 - 0
dbFiles/SendToDevice.php

@@ -0,0 +1,22 @@
+<?php
+function SendToDevice($title, $message, $regId)
+{
+    require_once('PushNotifications.php');
+    // Message payload, using data from post request
+    $msg_payload = array(
+        'mtitle' => $title,
+        'mdesc' => $message,
+    );
+    $var = new PushNotifications();
+    $var->android($msg_payload, $regId);
+}
+
+if ( $_SERVER['REQUEST_METHOD'] == 'POST' && (!empty($_POST['SendTo']))) {
+    SendToDevice($_POST['title'], $_POST['messageBody'], $_POST['SendTo']);
+}
+
+function SendYourTurnMessage($regId) {
+	SendToDevice("Din tur", "Det är din tur på När Kampen", $regId);
+}
+
+?>