diff --git a/namedropper/Assets/OntologyGame.cs b/namedropper/Assets/OntologyGame.cs index 43e4b15..89f8462 100644 --- a/namedropper/Assets/OntologyGame.cs +++ b/namedropper/Assets/OntologyGame.cs @@ -5,7 +5,8 @@ using UnityEngine; public class OntologyGame : Level { private float _timeToNextWord = 1f; - private GameObject _wordPrefab; + [SerializeField] GameObject _wordPrefab; + [SerializeField] Canvas _canvas; // Start is called before the first frame update void Start() @@ -22,14 +23,15 @@ public class OntologyGame : Level SpawnWord(); } - void SpawnWord() + void SpawnWord() { - GameObject newWOrd = GameObject.Instantiate(_wordPrefab); + GameObject newWord = GameObject.Instantiate(_wordPrefab); + newWord.transform.parent = _canvas.transform; - _timeToNextWord *= .9f; + _timeToNextWord *= .99f; - _timeToNextWord = Mathf.Min(_timeToNextWord, .1f); + _timeToNextWord = Mathf.Max(_timeToNextWord, .3f); Invoke("SpawnWord", _timeToNextWord); } @@ -39,7 +41,10 @@ public class OntologyGame : Level foreach (GameObject playerGo in _players) { Player player = playerGo.GetComponent(); - player.SetName(GameDataManager.Instance.GetRandomTopicData().Topic); + TopicData topicData = GameDataManager.Instance.GetRandomTopicData(); + + player.OntologyTopicData = topicData; + player.SetName(topicData.Topic); } } diff --git a/namedropper/Assets/OntologyWord.cs b/namedropper/Assets/OntologyWord.cs index ededa4c..0c9c7a8 100644 --- a/namedropper/Assets/OntologyWord.cs +++ b/namedropper/Assets/OntologyWord.cs @@ -4,10 +4,29 @@ using UnityEngine; public class OntologyWord : MonoBehaviour { + [SerializeField] TMPro.TextMeshProUGUI _text; + public CategoryData _categoryData; // Start is called before the first frame update void Start() { - + + } + + private void Awake() + { + Player[] players = FindObjectsOfType(); + Player randomPlayer = players[Random.Range(0, players.Length)]; + + _categoryData = GameDataManager.Instance.GetRandomCategoryData(randomPlayer.OntologyTopicData, false); + _text.text = _categoryData.Category; + Vector2 margin = new Vector2(0f, 0f); + this.transform.position = new Vector3(Random.Range(margin.x, 1920f - margin.x), Random.Range(margin.y, 1080f - margin.y), transform.position.z); + SetRandomTextRotation(); + } + + void SetRandomTextRotation() + { + _text.gameObject.transform.eulerAngles = new Vector3(0f, 0f, Random.Range(-10f, 10f)); } // Update is called once per frame diff --git a/namedropper/Assets/Prefabs/OntologyWord Prefab.prefab b/namedropper/Assets/Prefabs/OntologyWord Prefab.prefab index 4d05fda..af4df3d 100644 --- a/namedropper/Assets/Prefabs/OntologyWord Prefab.prefab +++ b/namedropper/Assets/Prefabs/OntologyWord Prefab.prefab @@ -10,6 +10,9 @@ GameObject: m_Component: - component: {fileID: 3175221214226580441} - component: {fileID: -7926489883287324733} + - component: {fileID: 4846301646102100694} + - component: {fileID: 6860308520948842749} + - component: {fileID: 5952941301532674086} m_Layer: 0 m_Name: OntologyWord Prefab m_TagString: Untagged @@ -26,10 +29,11 @@ Transform: m_GameObject: {fileID: 3665674534674050805} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 1.4, y: 1.4, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 139144834320043942} + - {fileID: 4468849727531685703} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -45,6 +49,149 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4027171ca26eb5048ac80ece3558cdd2, type: 3} m_Name: m_EditorClassIdentifier: + _text: {fileID: 3508529014437474819} + _categoryData: + Category: + Elements: [] +--- !u!50 &4846301646102100694 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3665674534674050805} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 0.5 + m_LinearDrag: 4.05 + m_AngularDrag: 0.05 + m_GravityScale: 20 + m_Material: {fileID: 0} + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 4 +--- !u!114 &6860308520948842749 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3665674534674050805} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 37dfc580ad57d894caaababe502afb5b, type: 3} + m_Name: + m_EditorClassIdentifier: + _useWorldSpace: 0 +--- !u!58 &5952941301532674086 +CircleCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3665674534674050805} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + serializedVersion: 2 + m_Radius: 62 +--- !u!1 &4889193101875992752 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4468849727531685703} + - component: {fileID: 8668407686013339453} + m_Layer: 0 + m_Name: sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4468849727531685703 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4889193101875992752} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 83, y: 83, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3175221214226580441} + 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: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!212 &8668407686013339453 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4889193101875992752} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + 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: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 3c63574e535edc34d8bcf1de05791dcb, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 160, y: 159} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &7173398024643427538 GameObject: m_ObjectHideFlags: 0 diff --git a/namedropper/Assets/Scenes/Ontology.unity b/namedropper/Assets/Scenes/Ontology.unity index 71194c3..a902ca0 100644 --- a/namedropper/Assets/Scenes/Ontology.unity +++ b/namedropper/Assets/Scenes/Ontology.unity @@ -391,11 +391,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.x - value: -458 + value: 69 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.y - value: 339 + value: 39 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -942,7 +942,7 @@ RectTransform: - {fileID: 1044471296} - {fileID: 1237273639} m_Father: {fileID: 1666960088} - m_RootOrder: 2 + 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} @@ -1149,116 +1149,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 1499098757095760799, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3} m_PrefabInstance: {fileID: 714773755} m_PrefabAsset: {fileID: 0} ---- !u!1001 &807489808 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1666960088} - m_Modifications: - - target: {fileID: 139144834320043942, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_SizeDelta.x - value: 110 - objectReference: {fileID: 0} - - target: {fileID: 139144834320043942, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_SizeDelta.y - value: 110 - objectReference: {fileID: 0} - - target: {fileID: 139144834320043942, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalPosition.z - value: 122.6 - objectReference: {fileID: 0} - - target: {fileID: 139144834320043942, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.w - value: 0.9992014 - objectReference: {fileID: 0} - - target: {fileID: 139144834320043942, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.z - value: -0.039957315 - objectReference: {fileID: 0} - - target: {fileID: 139144834320043942, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_AnchoredPosition.y - value: 1.85 - objectReference: {fileID: 0} - - target: {fileID: 139144834320043942, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: -4.58 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3508529014437474819, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_fontSize - value: 37.95 - objectReference: {fileID: 0} - - target: {fileID: 3508529014437474819, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_fontColor.b - value: 0.5334767 - objectReference: {fileID: 0} - - target: {fileID: 3508529014437474819, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_fontColor.g - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3508529014437474819, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_fontColor.r - value: 0.6698113 - objectReference: {fileID: 0} - - target: {fileID: 3508529014437474819, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_fontColor32.rgba - value: 4287103147 - objectReference: {fileID: 0} - - target: {fileID: 3665674534674050805, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_Name - value: OntologyWord Prefab - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} ---- !u!4 &807489809 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - m_PrefabInstance: {fileID: 807489808} - m_PrefabAsset: {fileID: 0} --- !u!1001 &881809258 PrefabInstance: m_ObjectHideFlags: 0 @@ -1440,11 +1330,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.x - value: -618 + value: -95 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.y - value: 154 + value: -128 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -2338,7 +2228,7 @@ RectTransform: - {fileID: 1152717270} - {fileID: 994779495} m_Father: {fileID: 1666960088} - m_RootOrder: 3 + 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} @@ -2943,6 +2833,63 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1308418707 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3665674534674050805, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + propertyPath: m_Name + value: OntologyWord Prefab + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} --- !u!1 &1391939818 GameObject: m_ObjectHideFlags: 0 @@ -2979,7 +2926,7 @@ RectTransform: - {fileID: 1131047766} - {fileID: 1217437522} m_Father: {fileID: 1666960088} - m_RootOrder: 4 + 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} @@ -3676,6 +3623,8 @@ MonoBehaviour: Timer: {fileID: 1225785573} RoundNumber: {fileID: 924483020} Topic: {fileID: 0} + _wordPrefab: {fileID: 3665674534674050805, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} + _canvas: {fileID: 1666960091} --- !u!1 &1666960087 GameObject: m_ObjectHideFlags: 0 @@ -3708,7 +3657,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 107001399} - - {fileID: 807489809} - {fileID: 554321083} - {fileID: 1146299635} - {fileID: 1391939819} @@ -3940,7 +3888,7 @@ RectTransform: - {fileID: 302674578} - {fileID: 1747069999} m_Father: {fileID: 1666960088} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -4335,7 +4283,7 @@ RectTransform: - {fileID: 881809259} - {fileID: 2050475644} m_Father: {fileID: 1666960088} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -4825,11 +4773,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.x - value: -615 + value: -96 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.y - value: 315 + value: 37 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_LocalEulerAnglesHint.x @@ -4976,63 +4924,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 1499098757095760799, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3} m_PrefabInstance: {fileID: 2090884023} m_PrefabAsset: {fileID: 0} ---- !u!1001 &1445199468395943343 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_RootOrder - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3175221214226580441, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3665674534674050805, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} - propertyPath: m_Name - value: OntologyWord - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 309c95694517eca4cbbbeb1502a2182c, type: 3} --- !u!1001 &1499098757172988272 PrefabInstance: m_ObjectHideFlags: 0 @@ -5315,11 +5206,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.x - value: -432 + value: 69 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_AnchoredPosition.y - value: 185 + value: -127 objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_LocalEulerAnglesHint.x diff --git a/namedropper/Assets/Scenes/Wheel Scene.unity b/namedropper/Assets/Scenes/Wheel Scene.unity index 9248303..d3084f0 100644 --- a/namedropper/Assets/Scenes/Wheel Scene.unity +++ b/namedropper/Assets/Scenes/Wheel Scene.unity @@ -3279,11 +3279,11 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: prizes: - - Name Dropper - - Bumper Budz - - Name Dropper - - Bumper Budz - - Bumper Budz + - Name
Dropper + - Bumper
Budz 500 + - Ontology:
The Game + - Name
Dropper + - Bumper
Budz 500 tingSound: {fileID: 8300000, guid: a4094b6328f12884d8f174a320bff865, type: 3} speedMultiplier: 4 duration: 6 diff --git a/namedropper/Assets/Scripts/GameDataManager.cs b/namedropper/Assets/Scripts/GameDataManager.cs index 0ffdd0b..f687cf0 100644 --- a/namedropper/Assets/Scripts/GameDataManager.cs +++ b/namedropper/Assets/Scripts/GameDataManager.cs @@ -36,13 +36,15 @@ public class GameDataManager { return topicData; } - public CategoryData GetRandomCategoryData(TopicData topicData) + public CategoryData GetRandomCategoryData(TopicData topicData, bool removeFromTopic = true) { int categoryIndex = Random.Range(0, topicData.Categories.Count); CategoryData categoryData = topicData.Categories[categoryIndex]; - topicData.Categories.RemoveAt(categoryIndex); + + if (removeFromTopic) + topicData.Categories.RemoveAt(categoryIndex); return categoryData; } diff --git a/namedropper/Assets/Scripts/Player.cs b/namedropper/Assets/Scripts/Player.cs index baba2f2..858813d 100644 --- a/namedropper/Assets/Scripts/Player.cs +++ b/namedropper/Assets/Scripts/Player.cs @@ -40,6 +40,15 @@ public class Player : MonoBehaviour float _powerupTimeLeft = 0f; public Player PassInputOnto = null; int _laps = 0; + public TopicData OntologyTopicData; + float _stunTime = 0f; + + public float StunTime{ + get + { + return _stunTime; + } + } public enum Team { @@ -375,6 +384,27 @@ public class Player : MonoBehaviour } _touchedMidpoint = false; } + + //ONTOLOGY GAME + OntologyWord ontologyWord = collision.gameObject.GetComponent(); + if (ontologyWord != null) + { + if (OntologyTopicData.Categories.Contains(ontologyWord._categoryData)) + { + GameObject.Destroy(ontologyWord.gameObject); + GameObject.FindObjectOfType().AddScore(1, _playerNumber); + } + else + { + float bounceStrength = 200f; + float wordBounceStrength = bounceStrength *.25f; + + this._rigidbody.AddForce((transform.position - collision.gameObject.transform.position) * bounceStrength); + collision.gameObject.GetComponent().AddForce((collision.gameObject.transform.position - transform.position) * wordBounceStrength); + + _stunTime = .4f; + } + } } @@ -417,6 +447,7 @@ public class Player : MonoBehaviour // Update is called once per frame void Update() { + _stunTime -= Time.deltaTime; if (Game.Paused) { GameObject.Destroy(this.gameObject); @@ -438,18 +469,20 @@ public class Player : MonoBehaviour //_spriteChild.transform.Rotate(Vector3.forward); - - if (Input.GetKey(_keyLeft)) - { - AddVelocity(new Vector2(_curSpeed * Time.deltaTime * -1f, 0f)); - } - if (Input.GetKey(_keyRight)) - { - AddVelocity(new Vector2(_curSpeed * Time.deltaTime, 0f)); - } - if (Input.GetKey(_keyDown)) + if (_stunTime <= 0) { - AddVelocity(new Vector2(0f, _curSpeed * Time.deltaTime * -1f)); + if (Input.GetKey(_keyLeft)) + { + AddVelocity(new Vector2(_curSpeed * Time.deltaTime * -1f, 0f)); + } + if (Input.GetKey(_keyRight)) + { + AddVelocity(new Vector2(_curSpeed * Time.deltaTime, 0f)); + } + if (Input.GetKey(_keyDown)) + { + AddVelocity(new Vector2(0f, _curSpeed * Time.deltaTime * -1f)); + } } if (Input.GetKey(_keyDrop) && ALLOW_DROP) diff --git a/namedropper/Assets/Scripts/TrackballInputManager.cs b/namedropper/Assets/Scripts/TrackballInputManager.cs index 3761d81..19ad61b 100644 --- a/namedropper/Assets/Scripts/TrackballInputManager.cs +++ b/namedropper/Assets/Scripts/TrackballInputManager.cs @@ -172,7 +172,10 @@ public class TrackballInputManager : MonoBehaviour //player.transform.position = new Vector2(player.transform.position.x + dx, player.transform.position.y - dy); //use this method to move using velocity - player.AddVelocity(new Vector2(dx, -dy)); + if (player.StunTime <= 0) + { + player.AddVelocity(new Vector2(dx, -dy)); + } } else { diff --git a/namedropper/Assets/Sprites/OntologyWord_bg.png b/namedropper/Assets/Sprites/OntologyWord_bg.png new file mode 100644 index 0000000..90cfde7 Binary files /dev/null and b/namedropper/Assets/Sprites/OntologyWord_bg.png differ diff --git a/namedropper/Assets/Sprites/OntologyWord_bg.png.meta b/namedropper/Assets/Sprites/OntologyWord_bg.png.meta new file mode 100644 index 0000000..4338574 --- /dev/null +++ b/namedropper/Assets/Sprites/OntologyWord_bg.png.meta @@ -0,0 +1,123 @@ +fileFormatVersion: 2 +guid: 3c63574e535edc34d8bcf1de05791dcb +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/namedropper/Assets/_FortuneWheel/Scripts/FortuneWheel.cs b/namedropper/Assets/_FortuneWheel/Scripts/FortuneWheel.cs index cd52dcd..9a71d33 100644 --- a/namedropper/Assets/_FortuneWheel/Scripts/FortuneWheel.cs +++ b/namedropper/Assets/_FortuneWheel/Scripts/FortuneWheel.cs @@ -150,11 +150,11 @@ string sceneName = ""; - if (_gameName == "Name Dropper") + if (_gameName.Contains("Dropper")) { sceneName = "TopicSelect"; } - else if (_gameName == "Indie 500" || _gameName == "Bumper Budz") + else if (_gameName == "Indie 500" || _gameName.Contains("Bumper")) { sceneName = "RaceGame"; } @@ -162,6 +162,10 @@ { sceneName = "RaceGame"; } + else if (_gameName.Contains("Ontology")) + { + sceneName = "OntologyGame"; + } else { Debug.LogError("unknown game name: " + _gameName); diff --git a/namedropper/Assets/_FortuneWheel/Scripts/WheelPart.cs b/namedropper/Assets/_FortuneWheel/Scripts/WheelPart.cs index c364662..6851a32 100644 --- a/namedropper/Assets/_FortuneWheel/Scripts/WheelPart.cs +++ b/namedropper/Assets/_FortuneWheel/Scripts/WheelPart.cs @@ -10,7 +10,7 @@ void Start() { myIndex = transform.GetSiblingIndex(); - valueText.text = FortuneWheelConfig.Instance.prizes[myIndex].ToString(); + valueText.text = FortuneWheelConfig.Instance.prizes[myIndex].ToString().Replace("
","\n"); } void OnTriggerEnter2D(Collider2D other) { diff --git a/namedropper/ProjectSettings/EditorBuildSettings.asset b/namedropper/ProjectSettings/EditorBuildSettings.asset index 60a7fe6..70e0f89 100644 --- a/namedropper/ProjectSettings/EditorBuildSettings.asset +++ b/namedropper/ProjectSettings/EditorBuildSettings.asset @@ -26,6 +26,9 @@ EditorBuildSettings: - enabled: 1 path: Assets/Scenes/Title.unity guid: dec16e3b1be4d704a89f82efa59198e4 + - enabled: 1 + path: Assets/Scenes/Ontology.unity + guid: ec616c0f27b0f8845836f55d5173b152 - enabled: 0 path: guid: 00000000000000000000000000000000