Browse Source

Added winner scene,

Added the how to play back into the client menu,
Fixed the block spawning issue (ran about 10 rounds with no errors),
Added another counter for the cannon so it shows both sides,
Removed some Debugs,
Made the fog not static,
Players can sucessfully disconnect from the game - their character is also removed and the server doesnt wait for their input
master
ClairePeta 4 years ago
parent
commit
de9fa199f3
27 changed files with 878 additions and 1122 deletions
  1. +95
    -0
      Assets/ConfettiMat.mat
  2. +8
    -0
      Assets/ConfettiMat.mat.meta
  3. +7
    -7
      Assets/Prefabs/GameManager.prefab
  4. +381
    -445
      Assets/Prefabs/Menu Background.prefab
  5. +210
    -0
      Assets/Prefabs/Traps/ShootingCannon + Block.prefab
  6. +0
    -3
      Assets/Resources/Sheep.png
  7. +0
    -143
      Assets/Resources/Sheep.png.meta
  8. +0
    -452
      Assets/Resources/Sheep.prefab
  9. +2
    -2
      Assets/Scenes/Client Scenes/ClientScene.unity
  10. +2
    -2
      Assets/Scenes/Client Scenes/MainMenu Client.unity
  11. +2
    -2
      Assets/Scenes/Levels/RaceTrack Beta.unity
  12. +2
    -2
      Assets/Scenes/Menus/MenuBackground.unity
  13. +3
    -0
      Assets/Scenes/Menus/Winner.unity
  14. +2
    -2
      Assets/Scenes/Menus/Winner.unity.meta
  15. +10
    -13
      Assets/Scripts/Character.cs
  16. +2
    -1
      Assets/Scripts/GlobalVariables.cs
  17. +2
    -2
      Assets/Scripts/Logic/Blocks/HookShot.cs
  18. +2
    -18
      Assets/Scripts/MainMenuControllerClient.cs
  19. +39
    -10
      Assets/Scripts/Managers/GameManager.cs
  20. +4
    -2
      Assets/Scripts/Map Generation/MapManager.cs
  21. +2
    -2
      Assets/Scripts/Map Generation/MapSection.cs
  22. +4
    -2
      Assets/Scripts/Networking/Server/ClientList.cs
  23. +3
    -0
      Assets/Scripts/Traps/ShootingCannon.cs
  24. +1
    -1
      Assets/Scripts/UI/NetworkedUIManager.cs
  25. +52
    -11
      Assets/Scripts/blockSpawn.cs
  26. +32
    -0
      Assets/Scripts/winnerscene.cs
  27. +11
    -0
      Assets/Scripts/winnerscene.cs.meta

+ 95
- 0
Assets/ConfettiMat.mat View File

@ -0,0 +1,95 @@
%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: ConfettiMat
m_Shader: {fileID: 210, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- ALWAYS
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:
- _BlendOp: 0
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _Cull: 2
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0
- _DstBlend: 0
- _EmissionEnabled: 0
- _FlipbookMode: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _LightingEnabled: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1
- _SoftParticlesNearFadeDistance: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}

+ 8
- 0
Assets/ConfettiMat.mat.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4983bff1554ecbf4ea1612ff69607b72
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

+ 7
- 7
Assets/Prefabs/GameManager.prefab View File

@ -45,7 +45,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
AnimationTime: 0.7
CurrentGameMode: {fileID: 11400000, guid: be8c78868a86aad448fd14e46bd40e51, type: 2}
CurrentGameMode: {fileID: 11400000, guid: 67476b9198c3f3a4c9443aa82f727331, type: 2}
characterPrefab: {fileID: 2862111851184665482, guid: c176f4ae8f7b4074db99b27b2e015a2a,
type: 3}
server: {fileID: 11400000, guid: aba6c842adfc9904dba334cb48257361, type: 2}
@ -64,29 +64,29 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
StrongLogicList:
- element: {fileID: 11400000, guid: 0ca3963afca0d5e4fa070615d94c4401, type: 2}
- element: {fileID: 11400000, guid: 7efcab7b8763f334ebf47148baaf4f0c, type: 2}
Count: 1
minCount: 1
isInfinit: 0
- element: {fileID: 11400000, guid: efab8a199b362cb42b3e0bce70dd05f4, type: 2}
- element: {fileID: 11400000, guid: b5887451436a375419e538ef3706ecf9, type: 2}
Count: 1
minCount: 1
isInfinit: 0
NormalLogicList:
- element: {fileID: 11400000, guid: 0b1bcd75cb7dade4fb598ee3412594c2, type: 2}
- element: {fileID: 11400000, guid: 8f19e10be0ee35345a97f600791a8747, type: 2}
Count: 1
minCount: 1
isInfinit: 0
- element: {fileID: 11400000, guid: 8f19e10be0ee35345a97f600791a8747, type: 2}
- element: {fileID: 11400000, guid: 0ca3963afca0d5e4fa070615d94c4401, type: 2}
Count: 1
minCount: 1
isInfinit: 0
WeakLogicList:
- element: {fileID: 11400000, guid: 7efcab7b8763f334ebf47148baaf4f0c, type: 2}
- element: {fileID: 11400000, guid: 752565cc5a95020498b9ed396343f3c0, type: 2}
Count: 1
minCount: 1
isInfinit: 0
- element: {fileID: 11400000, guid: b5887451436a375419e538ef3706ecf9, type: 2}
- element: {fileID: 11400000, guid: efab8a199b362cb42b3e0bce70dd05f4, type: 2}
Count: 1
minCount: 1
isInfinit: 0

+ 381
- 445
Assets/Prefabs/Menu Background.prefab
File diff suppressed because it is too large
View File


+ 210
- 0
Assets/Prefabs/Traps/ShootingCannon + Block.prefab View File

@ -1,5 +1,212 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1093512940060690779
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5847011123195338220}
- component: {fileID: 3140487336271024687}
- component: {fileID: 1392455422751305455}
- component: {fileID: 6284787942261125367}
- component: {fileID: 6305338656115376912}
m_Layer: 0
m_Name: Countdown Timer (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5847011123195338220
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1093512940060690779}
m_LocalRotation: {x: 0, y: 0.8055923, z: 0, w: 0.5924704}
m_LocalPosition: {x: 0, y: 0, z: 0.166}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6179448856766749153}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 107.335, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -0.262, y: 1.321}
m_SizeDelta: {x: 0.5, y: 0.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!23 &3140487336271024687
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1093512940060690779}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
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!33 &1392455422751305455
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1093512940060690779}
m_Mesh: {fileID: 0}
--- !u!222 &6284787942261125367
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1093512940060690779}
m_CullTransparentMesh: 0
--- !u!114 &6305338656115376912
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1093512940060690779}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, 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_text: 3
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 5
m_fontSizeBase: 5
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_textAlignment: 514
m_isAlignmentEnumConverted: 1
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: 0
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 0
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 6305338656115376912}
characterCount: 1
spriteCount: 0
spaceCount: 0
wordCount: 1
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_havePropertiesChanged: 0
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_isInputParsingRequired: 0
m_inputSource: 0
m_hasFontAssetChanged: 0
m_renderer: {fileID: 3140487336271024687}
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_maskType: 0
--- !u!1 &4265838743719489735
GameObject:
m_ObjectHideFlags: 0
@ -123,6 +330,7 @@ Transform:
- {fileID: 6183622079954844821}
- {fileID: 7559508468311915785}
- {fileID: 4546202105378142430}
- {fileID: 5847011123195338220}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -144,6 +352,7 @@ MonoBehaviour:
isPit: 0
isCrystals: 0
isRock: 0
isCollectableSpawnable: 0
isSpawnable: 0
SpawnDirection: 2
shootingRight: 1
@ -151,6 +360,7 @@ MonoBehaviour:
type: 3}
spawnLocation: {fileID: 6183695074135418386}
counter: {fileID: 7559508468311915784}
counter2: {fileID: 0}
--- !u!1 &6180422965807075217
GameObject:
m_ObjectHideFlags: 0

+ 0
- 3
Assets/Resources/Sheep.png View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:522fdc4257d43e845f922d6fa0a0ebb587a0b90a6f9524ef79f692b5b34046e6
size 17048

+ 0
- 143
Assets/Resources/Sheep.png.meta View File

@ -1,143 +0,0 @@
fileFormatVersion: 2
guid: 3f93b495dca0a4545ac22e96454ea174
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: tvOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 452
Assets/Resources/Sheep.prefab View File

@ -1,452 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1110675665442884
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4149966941573338}
m_Layer: 0
m_Name: Ear_R
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4149966941573338
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1110675665442884}
m_LocalRotation: {x: -1.9626155e-17, y: -1.110223e-16, z: 1.9626155e-17, w: 1}
m_LocalPosition: {x: 0.48915058, y: 0.87457556, z: 0.39776614}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4932805730445196}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1125765179216908
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4566454170960288}
m_Layer: 0
m_Name: LegFront_L
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4566454170960288
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1125765179216908}
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.5051645, y: 0.2578956, z: 0.24764504}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4932805730445196}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1227282385372154
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4311403792944626}
- component: {fileID: 95532307687615546}
m_Layer: 0
m_Name: Sheep
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4311403792944626
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1227282385372154}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_Children:
- {fileID: 4002890669728554}
- {fileID: 4682044010903744}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!95 &95532307687615546
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1227282385372154}
m_Enabled: 1
m_Avatar: {fileID: 9000000, guid: 1d53b7634ee14e129bdec0f6984bed9e, type: 3}
m_Controller: {fileID: 22100000, guid: 4cb10b63784a4afd9daecf578ff9abce, type: 2}
m_CullingMode: 1
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1 &1272573732725968
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4825960712621770}
m_Layer: 0
m_Name: Eye_L
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4825960712621770
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1272573732725968}
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.1689518, y: 0.6226432, z: 0.505063}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4932805730445196}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1326382756001364
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4682044010903744}
m_Layer: 0
m_Name: Sheep_Root
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4682044010903744
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1326382756001364}
m_LocalRotation: {x: 0, y: 1.110223e-16, z: -0, w: 1}
m_LocalPosition: {x: -0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4932805730445196}
m_Father: {fileID: 4311403792944626}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1329486559451270
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4571661085782490}
m_Layer: 0
m_Name: LegBack_R
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4571661085782490
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1329486559451270}
m_LocalRotation: {x: 0, y: -3.330669e-16, z: -2.614729e-32, w: 1}
m_LocalPosition: {x: 0.50516397, y: 0.257895, z: -0.247646}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4932805730445196}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1401873917001132
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4075108810817546}
m_Layer: 0
m_Name: LegBack_L
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4075108810817546
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1401873917001132}
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.5051645, y: 0.2578956, z: -0.24764505}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4932805730445196}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1532800149339754
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4932805730445196}
m_Layer: 0
m_Name: Body
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4932805730445196
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1532800149339754}
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0, y: 0.100011006, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4989792614370424}
- {fileID: 4149966941573338}
- {fileID: 4825960712621770}
- {fileID: 4581654969522252}
- {fileID: 4075108810817546}
- {fileID: 4571661085782490}
- {fileID: 4566454170960288}
- {fileID: 4844798015206692}
m_Father: {fileID: 4682044010903744}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1843997783847048
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4844798015206692}
m_Layer: 0
m_Name: LegFront_R
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4844798015206692
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1843997783847048}
m_LocalRotation: {x: 1, y: -6.162976e-33, z: 3.330669e-16, w: -6.123234e-17}
m_LocalPosition: {x: 0.50516397, y: 0.257895, z: 0.247646}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4932805730445196}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1862279118893864
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4989792614370424}
m_Layer: 0
m_Name: Ear_L
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4989792614370424
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1862279118893864}
m_LocalRotation: {x: 1.9626155e-17, y: -1.110223e-16, z: -1.9626155e-17, w: 1}
m_LocalPosition: {x: -0.5, y: 0.8818372, z: 0.4250074}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4932805730445196}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1969737586521606
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4581654969522252}
m_Layer: 0
m_Name: Eye_R
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4581654969522252
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1969737586521606}
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.1689518, y: 0.6226432, z: 0.505063}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4932805730445196}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1982144457908006
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4002890669728554}
- component: {fileID: 137495651086942118}
m_Layer: 0
m_Name: Sheep
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4002890669728554
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1982144457908006}
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_Children: []
m_Father: {fileID: 4311403792944626}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!137 &137495651086942118
SkinnedMeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1982144457908006}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 5803214f7009463c8a5d1b533e716e4e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
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
serializedVersion: 2
m_Quality: 0
m_UpdateWhenOffscreen: 0
m_SkinnedMotionVectors: 1
m_Mesh: {fileID: 4300000, guid: 1d53b7634ee14e129bdec0f6984bed9e, type: 3}
m_Bones:
- {fileID: 4932805730445196}
- {fileID: 4566454170960288}
- {fileID: 4075108810817546}
- {fileID: 4825960712621770}
- {fileID: 4581654969522252}
- {fileID: 4844798015206692}
- {fileID: 4571661085782490}
- {fileID: 4989792614370424}
- {fileID: 4149966941573338}
m_BlendShapeWeights: []
m_RootBone: {fileID: 4932805730445196}
m_AABB:
m_Center: {x: 0, y: 0.56233203, z: -0.0484277}
m_Extent: {x: 0.8096602, y: 0.6624131, z: 0.5775191}
m_DirtyAABB: 0

+ 2
- 2
Assets/Scenes/Client Scenes/ClientScene.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:74aaf18601d78aed33b620ecba791e2734854d3470f3a821c27cf21c3062724b
size 16428
oid sha256:d5fd8a28b8f51589186c919c3094f2b367da1768b03455104232fc0603bcaaa1
size 17369

+ 2
- 2
Assets/Scenes/Client Scenes/MainMenu Client.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:30ff94cec01f8918d38e805f743fbb5377ebe60d129a33158cba29fda8088c60
size 142860
oid sha256:60fa54600cfd411949baa79ddd05d0f2eb5d8deab6cc41f83638f388d8fedf0e
size 99675

+ 2
- 2
Assets/Scenes/Levels/RaceTrack Beta.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:34f4ddc3b7c7bec2e062a4fc81494f4173b18acadb589f7ad805b4589ec939e7
size 35308
oid sha256:9b3466a08e64206f4cd8bfd28202d1c8249dfa16454f0f020ec44634b894b76f
size 30788

+ 2
- 2
Assets/Scenes/Menus/MenuBackground.unity View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d152ce97c5084509f547f8bbdf75c396d9c1508d29dc5ba2cfcf77bd507d48e3
size 2920510
oid sha256:938028e3e34d6913220202dea3966b1045ee47ce508d2fdff1f3418cfaf0801c
size 2851355

+ 3
- 0
Assets/Scenes/Menus/Winner.unity View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e62bdae22d08b1fbd7145b5f83eee45b96df3adbb2c194b8eed5dc4c19a1eef1
size 311659

Assets/Resources/Sheep.prefab.meta → Assets/Scenes/Menus/Winner.unity.meta View File

@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 8e5b08cc42cc0b84cb71a8eca3ca36b8
PrefabImporter:
guid: c3dc1a923d0d69141b3afade7f3a5af4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:

+ 10
- 13
Assets/Scripts/Character.cs View File

@ -175,8 +175,6 @@ public class Character : MonoBehaviour
public void StartAnimation(Animation animation,float speed = 1)
{
characterAnimator.SetFloat("AnimationSpeed", (1 / speed));
switch (animation)
{
case Animation.Walk:
@ -204,7 +202,6 @@ public class Character : MonoBehaviour
public void StopAnimation(Animation animation)
{
characterAnimator.SetFloat("AnimationSpeed", 1f);
switch (animation)
{
case Animation.Walk:
@ -235,20 +232,20 @@ public class Character : MonoBehaviour
//We start from the position of our pit, at ground level
Vector3 currentPos = respawnPosition;
Debug.Log("Commencing respawn");
//Debug.Log("Commencing respawn");
//Hardcoding the number of iterations for now for simplicity, should change this later
for (int i = 0; i < 100; i++)
{
//First we check one back
currentPos.x -= 1;
Debug.Log("currentPos = " + currentPos.x + ", " + currentPos.y + ", " + currentPos.z);
//Debug.Log("currentPos = " + currentPos.x + ", " + currentPos.y + ", " + currentPos.z);
if (Block.isBlockAtPosition(currentPos, 1, ~Ignore, out currentBlock)) //Does a block exist here?
{
Debug.Log("Block exists");
//Debug.Log("Block exists");
if (currentBlock.isWalkable(~Ignore)) //If so, can we walk on it?
{
Debug.Log("Block is walkable");
//Debug.Log("Block is walkable");
//Don't yet have a check for whether it's occupied
break; //If it is, we stop here
}
@ -256,25 +253,25 @@ public class Character : MonoBehaviour
//If the block one back isn't an option, we check to the left and right
currentPos.z += 1;
Debug.Log("currentPos = " + currentPos.x + ", " + currentPos.y + ", " + currentPos.z);
//Debug.Log("currentPos = " + currentPos.x + ", " + currentPos.y + ", " + currentPos.z);
if (Block.isBlockAtPosition(currentPos, 1, ~Ignore, out currentBlock)) //Does a block exist here?
{
Debug.Log("Block exists");
//Debug.Log("Block exists");
if (currentBlock.isWalkable(~Ignore)) //If so, can we walk on it?
{
Debug.Log("Block is walkable");
//Debug.Log("Block is walkable");
//Don't yet have a check for whether it's occupied
break; //If it is, we stop here
}
}
currentPos.z -= 2;
Debug.Log("currentPos = " + currentPos.x + ", " + currentPos.y + ", " + currentPos.z);
//Debug.Log("currentPos = " + currentPos.x + ", " + currentPos.y + ", " + currentPos.z);
if (Block.isBlockAtPosition(currentPos, 1, ~Ignore, out currentBlock)) //Does a block exist here?
{
Debug.Log("Block exists");
//Debug.Log("Block exists");
if (currentBlock.isWalkable(~Ignore)) //If so, can we walk on it?
{
Debug.Log("Block is walkable");
//Debug.Log("Block is walkable");
//Don't yet have a check for whether it's occupied
break; //If it is, we stop here
}

+ 2
- 1
Assets/Scripts/GlobalVariables.cs View File

@ -8,5 +8,6 @@ public static class GlobalVariables
public static bool musicVolume = true;
public static bool playerMoves = true;
public static int difficulty = 1;
public static string winnername = "Claire";
public static string winneranimal = "Cat";
}

+ 2
- 2
Assets/Scripts/Logic/Blocks/HookShot.cs View File

@ -57,12 +57,12 @@ public class HookShot : LogicBlock
protected override IEnumerator BlockLogic(Character player, float animationTime, bool useBlockDirection = false)
{
Block hitBlock = GetEndBlock(player.CurrentBlock, player.transform, ~player.Ignore);
Debug.Log("hookshot: " + hitBlock.position, hitBlock.gameObject);
//Debug.Log("hookshot: " + hitBlock.position, hitBlock.gameObject);
if (hitBlock == player.CurrentBlock)
yield break;
Debug.Log("Instantiating shot");
//Debug.Log("Instantiating shot");
GameObject shot = GameObject.CreatePrimitive(PrimitiveType.Sphere);
shot.transform.localScale = Vector3.one * 0.33f;
yield return player.StartCoroutine(lerpShot(shot.transform, player.transform.position, hitBlock.VisualPosition,ShotSpeed));

+ 2
- 18
Assets/Scripts/MainMenuControllerClient.cs View File

@ -7,7 +7,6 @@ public class MainMenuControllerClient : MonoBehaviour
{
public GameObject MainMenu;
public GameObject HowToPlayMenu;
public GameObject HowToPlayMenu_aim;
public GameObject HowToPlayMenu_inventory;
//On Awake
@ -15,45 +14,30 @@ public class MainMenuControllerClient : MonoBehaviour
{
MainMenu.SetActive (true);
HowToPlayMenu.SetActive(false);
HowToPlayMenu_aim.SetActive (false);
HowToPlayMenu_inventory.SetActive(false);
}
//Main Menu Options
public void OnPlayClick ()
{
UnityEngine.SceneManagement.SceneManager.LoadScene ("LoginScreen");
}
public void OnTutorialClick ()
public void OnHowToPlayClick ()
{
MainMenu.SetActive (false);
HowToPlayMenu.SetActive (true);
}
public void OnTutorialContinueClick()
public void OnContinueClick()
{
HowToPlayMenu.SetActive(false);
HowToPlayMenu_aim.SetActive(true);
}
public void OnTutorialContinueAimClick ()
{
HowToPlayMenu_aim.SetActive(false);
HowToPlayMenu_inventory.SetActive(true);
}
public void OnTutorialContinueInventroyClick()
{
UnityEngine.SceneManagement.SceneManager.LoadScene("TuteLevelOne");
}
public void OnBacktomainmenuClick()
{
HowToPlayMenu.SetActive(false);
HowToPlayMenu_aim.SetActive(false);
HowToPlayMenu_inventory.SetActive(false);
MainMenu.SetActive(true);
}
}

+ 39
- 10
Assets/Scripts/Managers/GameManager.cs View File

@ -98,6 +98,25 @@ public class GameManager : MonoBehaviour
//Loop until the GameMode lets us know the game is over
while (!gameMode.isGameOver(playerDataAsArray))
{
int playersalive_left = 0;
int spotinarray = 0;
int players = 0;
//check here if one player left
foreach(PlayerData data in playerDataAsArray)
{
players++;
if (data.character.lives > 0)
{
playersalive_left++;
spotinarray = players;
}
}
/*if(playersalive_left == 1)
{
GlobalVariables.winneranimal = playerDataAsArray[spotinarray].client.characterAnimal;
GlobalVariables.winnername = playerDataAsArray[spotinarray].client.Name;
SceneManager.LoadScene("Winner");
}*/
//wait until we have recieved all player input
yield return StartCoroutine(WaitForPlayerInput());
@ -125,15 +144,7 @@ public class GameManager : MonoBehaviour
//Tell the gamemode that we are starting a round
gameMode.RoundStart(playerDataAsArray);
//playerDataAsArray.OrderByDescending(unit => unit.character.transform.position.x);
//playerDataAsArray = playerDataAsArray.OrderBy(unit => unit.character.CurrentBlock.transform.position.x).ToArray();
playerData = playerData.OrderBy(unit => unit.Value.character.CurrentBlock.transform.position.x).ToDictionary(unit => unit.Key, unit => unit.Value);
int order = 1;
foreach (PlayerData data in playerDataAsArray)
{
data.character.runOrder = order;
order++;
}
//Loop until all players have finished moving
while (playerDataAsArray.Any(p => !p.blockReader.Finished))
@ -185,6 +196,7 @@ public class GameManager : MonoBehaviour
}
}
//spawn collectible logic blocks
Debug.Log("Spawwn script called from manager");
spawnBlock.Spawn();
@ -197,6 +209,14 @@ public class GameManager : MonoBehaviour
player.client.SendInventory();
}
}
playerData = playerData.OrderBy(unit => unit.Value.character.CurrentBlock.transform.position.x).ToDictionary(unit => unit.Key, unit => unit.Value);
int order = 1;
foreach (PlayerData data in playerDataAsArray)
{
data.character.runOrder = order;
order++;
}
}
private IEnumerator WaitForPlayerInput()
@ -205,6 +225,15 @@ public class GameManager : MonoBehaviour
//#TODO make this only happen after first input
LogicProtocols.FloatMsg RoundTime = new LogicProtocols.FloatMsg(gameMode.GetRoundTime());
foreach (PlayerData player in playerDataAsArray)
{
if (player.client.Lives == 0)
{
//Debug.Log("Remove: " + player.client.characterAnimal);
removePlayer(player);
}
}
//playerDataAsArray.ForEach(p => p.client.conn.Send(LogicProtocols.SendRoundTime, RoundTime));
foreach (PlayerData player in playerDataAsArray)
{
@ -225,7 +254,7 @@ public class GameManager : MonoBehaviour
gameMode.InputStart(playerDataAsArray);
//wait for all players to
yield return new WaitUntil(() => playerData.All(p => p.Value.recievedList || p.Value.isDead));
yield return new WaitUntil(() => playerData.All(p => p.Value.recievedList || p.Value.isDead || p.Value.character.lives == 0));
//reset
//playerDataAsArray.ForEach(p => p.recievedList = false); //reset all players list

+ 4
- 2
Assets/Scripts/Map Generation/MapManager.cs View File

@ -353,9 +353,12 @@ public class MapManager : ScriptableObject
//If it's not, then we remove it
if (!(checkView(firstSectionEnd)))
{
spawn.GetComponent<blockSpawn>().updatePositions(startX + activeSections[0].length);
startX += activeSections[0].length;
spawn.GetComponent<blockSpawn>().updatePositions(startX);
activeSections[0].destroySection();
activeSections.RemoveAt(0);
}
}
@ -372,7 +375,7 @@ public class MapManager : ScriptableObject
public void checkTrack()
{
checkForward();
checkBack();
checkBack();
}
//Updates minimum and maximum difficulty, width, etc, based on current gamestate
@ -444,7 +447,6 @@ public class MapManager : ScriptableObject
{
widthMax = widthMaxMin;
}
}
// Update is called once per frame

+ 2
- 2
Assets/Scripts/Map Generation/MapSection.cs View File

@ -65,8 +65,8 @@ public class MapSection : MonoBehaviour
/*Debug.Log("Destroying section " + name + ", position = " + transform.position.x + ", " + transform.position.y + ", " + transform.position.z);
gameObject.transform.position = new Vector3(0.0f, 0.0f, 1000.0f);*/
Debug.Log("Destroying section " + name + ", position = " + transform.position.x + ", " + transform.position.y + ", " + transform.position.z);
//Debug.Log("Destroying section " + name + ", position = " + transform.position.x + ", " + transform.position.y + ", " + transform.position.z);
//gameObject.SetActive(false);
Destroy(gameObject);
Destroy(gameObject, 0.0f);
}
}

+ 4
- 2
Assets/Scripts/Networking/Server/ClientList.cs View File

@ -76,7 +76,7 @@ namespace Networking.Server
public void OnClientConnect(NetworkMessage msg)
{
Debug.Log("newClient: " + msg.conn.address + ", " + msg.conn.Hash() + ", " + msg.conn.hostId);
//Debug.Log("newClient: " + msg.conn.address + ", " + msg.conn.Hash() + ", " + msg.conn.hostId);
if (ConnectedClients.Any(p => p.ID == msg.channelId))
{
@ -103,6 +103,8 @@ namespace Networking.Server
}
ClientData client = ConnectedClients.FirstOrDefault(p => p.ID == msg.conn.Hash());
client.Lives = 0;
client.playerCharacter.lives = 0;
ConnectedClients.Remove(client);
DisconnectedClients.Add(client);
@ -110,7 +112,7 @@ namespace Networking.Server
PotentialClients.ForEach(p => p.Send(LoginProtocols.OtherClientDisconnected, new LoginProtocols.LoginMsg(client.Name, client.Color, client.characterAnimal)));
Debug.Log("Disconnected: " + client.Name);
//somewhere here we need to remove the disconnected client from the client list and update such things
OnClientsChange.Invoke(ConnectedClients);
OnClientsChange?.Invoke(ConnectedClients);
}
public void OnClientLogin(NetworkMessage msg)

+ 3
- 0
Assets/Scripts/Traps/ShootingCannon.cs View File

@ -11,6 +11,7 @@ public class ShootingCannon : ActiveBlock
public GameObject shootingObject;
public Transform spawnLocation;
public TextMeshPro counter;
public TextMeshPro counter2;
int countdowntimer = 3;
int countdown;
@ -27,6 +28,8 @@ public class ShootingCannon : ActiveBlock
private void Update()
{
counter.text = countdown.ToString();
counter2.text = countdown.ToString();
}
public override IEnumerator OnEnvironmentTurn(PlayerData[] allPlayers)

+ 1
- 1
Assets/Scripts/UI/NetworkedUIManager.cs View File

@ -34,7 +34,7 @@ public class NetworkedUIManager : PlayerUIManager
StartTime = Time.time;
ShowPosition.y -= Title.rect.height;
LivesText.text = "Lives: " + Client.RemainingLives;
backgroundColour.color = Client.PlayerColor;
//backgroundColour.color = Client.PlayerColor;
animalSprite.sprite = Resources.Load<Sprite>(Client.PlayerAnimal.ToString());
OnClick_Show();
}

+ 52
- 11
Assets/Scripts/blockSpawn.cs View File

@ -17,6 +17,7 @@ public class blockSpawn : MonoBehaviour
List<Vector3> spawnedLocations;
public List<Block> possibleSpawnLocations;
int spawnNumber = 2;
public int min_x, max_x;
void Awake()
{
@ -38,13 +39,18 @@ public class blockSpawn : MonoBehaviour
ConnectedClients.Sort((b, a) => a.playerCharacter.transform.position.x.CompareTo(b.playerCharacter.transform.position.x));
}
//add two to each to set bounds
int min_x = (int)ConnectedClients[ConnectedClients.Count - 1].playerCharacter.transform.position.x;
int max_x = (int)ConnectedClients[0].playerCharacter.transform.position.x +2;
//Debug.Log("Min x: " + min_x + " max x: " + max_x);
min_x = (int)ConnectedClients[ConnectedClients.Count - 1].playerCharacter.transform.position.x;
max_x = (int)ConnectedClients[0].playerCharacter.transform.position.x +3;
Debug.Log("count before update " + SpawnBlocks.Count);
updatePositions(min_x - 1);
updatePlayerPositions();
Debug.Log("count after update " + SpawnBlocks.Count);
Debug.Log("adding possible spawn locations");
//Check points within the bounds of players
foreach(Block point in SpawnBlocks)
possibleSpawnLocations.Clear();
foreach (Block point in SpawnBlocks)
{
//Debug.Log("Position: " + point.transform.position.x + " and " + point.transform.position.z);
if(point.transform.position.x >= min_x && point.transform.position.x <= max_x)
@ -55,43 +61,56 @@ public class blockSpawn : MonoBehaviour
//pick a random value from those available, checks the location
//then removes it to remove the possibility of duplicates
//Debug.Log(possibleSpawnLocations.Count);
Debug.Log("count after add " + possibleSpawnLocations.Count);
if(possibleSpawnLocations.Count > 0)
{
while (spawnNumber > 0)
{
if(possibleSpawnLocations.Count > 0){
int choice = Random.Range(0, possibleSpawnLocations.Count - 1);
Debug.Log("count inside " + possibleSpawnLocations.Count);
bool spawned = checkLocation(possibleSpawnLocations[choice].transform.position);
Debug.Log("bool spawned = " + spawned);
if (spawned == true)
{
possibleSpawnLocations.RemoveAt(choice);
spawnNumber--;
}
}else{
continue;
}
}
else
{
Debug.Log("spawn else");
goto escape;
}
Debug.Log("spawnNumber " + spawnNumber);
}
}
escape:
spawnNumber = 2;
}
private bool checkLocation(Vector3 spawnposition)
{
Debug.Log("Check location function");
bool duplicate = checkDuplicatePosition(spawnposition);
if (duplicate == false)
{
spawnBlock(spawnposition);
Debug.Log("spawned at" + spawnposition);
return true;
}
else
{
Debug.Log("Fail to spawn - duplicate positioning");
Debug.Log("Fail to spawn at " + spawnposition);
return false;
}
}
private bool checkDuplicatePosition(Vector3 spawnposition)
{
Debug.Log("Check duplicate function");
if (spawnedLocations.Count > 0)
{
for (int k = 0; k < spawnedLocations.Count; k++)
@ -109,7 +128,7 @@ public class blockSpawn : MonoBehaviour
{
GameObject prefab = Resources.Load("Logic Block") as GameObject;
GameObject block = Instantiate(prefab);
spawnposition.y += 1.5f;
spawnposition.y = 1.0f;
block.transform.position = spawnposition;
spawnedLocations.Add(spawnposition);
}
@ -137,4 +156,26 @@ public class blockSpawn : MonoBehaviour
block.GetComponent<LogicCollectable_Multiplayer>().Collectable.element = listtoUse[number].element;
block.GetComponent<LogicCollectable_Multiplayer>().Collectable.Count = 1;
}
public void updatePositions(float max)
{
for(int i = SpawnBlocks.Count -1; i>=0; i--)
{
if(SpawnBlocks[i].transform.position.x <= (int)max)
{
SpawnBlocks.Remove(SpawnBlocks[i]);
}
}
}
public void updatePlayerPositions()
{
for (int i = SpawnBlocks.Count - 1; i >= 0; i--)
{
if (SpawnBlocks[i].CurrentPlayer != null)
{
SpawnBlocks.Remove(SpawnBlocks[i]);
}
}
}
}

+ 32
- 0
Assets/Scripts/winnerscene.cs View File

@ -0,0 +1,32 @@
using Networking.Server;
using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
public class winnerscene : MonoBehaviour
{
public ClientList clientDataList;
public ServerObject serverObj;
public GameObject winname;
public Transform characterPosition;
private void Awake()
{
//GameObject character = Resources.Load<>
GameObject prefab = Resources.Load<GameObject>(GlobalVariables.winneranimal);
GameObject character = Instantiate(prefab, characterPosition);
character.transform.rotation = Quaternion.Euler(0, 152.775f, 0);
winname.GetComponent<TextMeshProUGUI>().text = GlobalVariables.winnername;
StartCoroutine(displayforSeconds());
}
IEnumerator displayforSeconds()
{
clientDataList.server.DisconnectAllConnections();
yield return new WaitForSeconds(10.0f);
serverObj.ServerClose();
SceneManager.LoadScene("MainMenu Server");
}
}

+ 11
- 0
Assets/Scripts/winnerscene.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4790e0245f29c684e85d5fbdf57eb1b5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save