From 4e7c322288a7a57c6394b42a9a3a86dd2961c063 Mon Sep 17 00:00:00 2001 From: William Jiang Date: Wed, 31 Oct 2018 12:07:38 -0400 Subject: [PATCH] added co-rountine (incomplete) --- Blockade/Assets/Blockade.cs | 40 ++- .../SampleScene.unity.meta => Plugins.meta} | 3 +- Blockade/Assets/Plugins/Editor.meta | 8 + Blockade/Assets/Plugins/Editor/JetBrains.meta | 8 + ...ider.Unity.Editor.Plugin.Repacked.dll.meta | 30 +++ .../Assets/{ => Scenes}/BlockadeScene.unity | 0 .../{ => Scenes}/BlockadeScene.unity.meta | 0 Blockade/Assets/Scenes/SampleScene.unity | 237 ------------------ Blockade/ProjectSettings/EditorSettings.asset | 3 +- Blockade/ProjectSettings/ProjectVersion.txt | 2 +- 10 files changed, 86 insertions(+), 245 deletions(-) rename Blockade/Assets/{Scenes/SampleScene.unity.meta => Plugins.meta} (67%) create mode 100644 Blockade/Assets/Plugins/Editor.meta create mode 100644 Blockade/Assets/Plugins/Editor/JetBrains.meta create mode 100644 Blockade/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll.meta rename Blockade/Assets/{ => Scenes}/BlockadeScene.unity (100%) rename Blockade/Assets/{ => Scenes}/BlockadeScene.unity.meta (100%) delete mode 100644 Blockade/Assets/Scenes/SampleScene.unity diff --git a/Blockade/Assets/Blockade.cs b/Blockade/Assets/Blockade.cs index 26a585b..37f834e 100644 --- a/Blockade/Assets/Blockade.cs +++ b/Blockade/Assets/Blockade.cs @@ -11,13 +11,13 @@ public class Blockade : MonoBehaviour { public TextMesh s1; public TextMesh s2; - public Sprite green; - public Sprite black; + public static Sprite green; + public static Sprite black; public Vector3 direction; public Vector3 direction2; - public Vector3 current; - public Vector3 current2; + public static Vector3 current; + public static Vector3 current2; public int score1; public int score2; @@ -25,7 +25,7 @@ public class Blockade : MonoBehaviour { public float timer = 0f; - GameObject[,] grid = new GameObject[100, 100]; + static GameObject[,] grid = new GameObject[100, 100]; // Use this for initialization @@ -158,4 +158,34 @@ void gameOver(int s) bkgd.Play(); } + + + IEnumerator gameoverTransition(int s); + { + for (int i = 0; i < 15; i++) + { + if(s == 1 && i % 3 == 0) + { + if ((grid[(int) current.x, (int) current.y].GetComponent().sprite == green)) + { + grid[(int) current.x, (int) current.y].GetComponent().sprite = black; + } + else + { + grid[(int) current.x, (int) current.y].GetComponent().sprite = green; + } + } + else if(s == 2 && i % 3 == 0) + { + if ((grid[(int) current2.x, (int) current2.y].GetComponent().sprite == green)) + { + grid[(int) current2.x, (int) current2.y].GetComponent().sprite = black; + } + else + { + grid[(int) current2.x, (int) current2.y].GetComponent().sprite = green; + } + } + } + } } diff --git a/Blockade/Assets/Scenes/SampleScene.unity.meta b/Blockade/Assets/Plugins.meta similarity index 67% rename from Blockade/Assets/Scenes/SampleScene.unity.meta rename to Blockade/Assets/Plugins.meta index c1e3c88..e47e44f 100644 --- a/Blockade/Assets/Scenes/SampleScene.unity.meta +++ b/Blockade/Assets/Plugins.meta @@ -1,5 +1,6 @@ fileFormatVersion: 2 -guid: 2cda990e2423bbf4892e6590ba056729 +guid: e28131def6d2cdb4cb35134eccb71600 +folderAsset: yes DefaultImporter: externalObjects: {} userData: diff --git a/Blockade/Assets/Plugins/Editor.meta b/Blockade/Assets/Plugins/Editor.meta new file mode 100644 index 0000000..f75c729 --- /dev/null +++ b/Blockade/Assets/Plugins/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1a24f5a63e90f014883814447f099a2f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Blockade/Assets/Plugins/Editor/JetBrains.meta b/Blockade/Assets/Plugins/Editor/JetBrains.meta new file mode 100644 index 0000000..633b14f --- /dev/null +++ b/Blockade/Assets/Plugins/Editor/JetBrains.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8abdd84ba65e6d547b07e865b434c2f6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Blockade/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll.meta b/Blockade/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll.meta new file mode 100644 index 0000000..ab472c3 --- /dev/null +++ b/Blockade/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll.meta @@ -0,0 +1,30 @@ +fileFormatVersion: 2 +guid: 475cc86e7a268f34da7806189b281ccf +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Blockade/Assets/BlockadeScene.unity b/Blockade/Assets/Scenes/BlockadeScene.unity similarity index 100% rename from Blockade/Assets/BlockadeScene.unity rename to Blockade/Assets/Scenes/BlockadeScene.unity diff --git a/Blockade/Assets/BlockadeScene.unity.meta b/Blockade/Assets/Scenes/BlockadeScene.unity.meta similarity index 100% rename from Blockade/Assets/BlockadeScene.unity.meta rename to Blockade/Assets/Scenes/BlockadeScene.unity.meta diff --git a/Blockade/Assets/Scenes/SampleScene.unity b/Blockade/Assets/Scenes/SampleScene.unity deleted file mode 100644 index 731c034..0000000 --- a/Blockade/Assets/Scenes/SampleScene.unity +++ /dev/null @@ -1,237 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 3 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 0 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 10 - m_Resolution: 2 - m_BakeResolution: 40 - m_AtlasSize: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 0 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 500 - m_PVRBounces: 2 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVRFilteringMode: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ShowResolutionOverlay: 1 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &344894613 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 344894615} - - component: {fileID: 344894614} - m_Layer: 0 - m_Name: GameScript - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &344894614 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 344894613} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b38780f1ca2fdde458bb4159e2f77121, type: 3} - m_Name: - m_EditorClassIdentifier: - gridBlock: {fileID: 1213175619161390, guid: 8677364eea4efc64eb349980421f47a4, type: 2} - green: {fileID: 21300000, guid: 16d971f09cd237b458a175048905e832, type: 3} - direction: {x: 0, y: 0, z: 0} - current: {x: 0, y: 0, z: 0} - timer: 0 ---- !u!4 &344894615 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 344894613} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1.5642519, y: 6.239425, z: -1.9474795} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &519420028 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 519420032} - - component: {fileID: 519420031} - - component: {fileID: 519420029} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &519420029 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 519420028} - m_Enabled: 1 ---- !u!20 &519420031 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 519420028} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 2 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 1 - orthographic size: 52 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 0 - m_HDR: 1 - m_AllowMSAA: 0 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 0 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &519420032 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 519420028} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Blockade/ProjectSettings/EditorSettings.asset b/Blockade/ProjectSettings/EditorSettings.asset index 8d9e83b..1eee343 100644 --- a/Blockade/ProjectSettings/EditorSettings.asset +++ b/Blockade/ProjectSettings/EditorSettings.asset @@ -14,8 +14,9 @@ EditorSettings: m_EtcTextureFastCompressor: 1 m_EtcTextureNormalCompressor: 2 m_EtcTextureBestCompressor: 4 - m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef m_ProjectGenerationRootNamespace: m_UserGeneratedProjectSuffix: m_CollabEditorSettings: inProgressEnabled: 1 + m_EnableTextureStreamingInPlayMode: 1 diff --git a/Blockade/ProjectSettings/ProjectVersion.txt b/Blockade/ProjectSettings/ProjectVersion.txt index 6169583..410e07a 100644 --- a/Blockade/ProjectSettings/ProjectVersion.txt +++ b/Blockade/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.2.7f1 +m_EditorVersion: 2018.2.8f1