From faa680d335a005073e17132e3c6a53ce903a96ee Mon Sep 17 00:00:00 2001 From: kimura Date: Wed, 21 Jul 2021 17:29:20 +0900 Subject: [PATCH 1/9] =?UTF-8?q?=E3=83=9F=E3=82=B9=E6=BC=94=E5=87=BA?= =?UTF-8?q?=E5=91=A8=E3=82=8A=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/Cooking/Scripts/CornManager.cs | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs index 6949cfb9..dd7fe019 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs @@ -18,11 +18,6 @@ public class CornManager : MonoBehaviour [SerializeField] private Transform cornSpawnTarget; [SerializeField] private Corn cornPrefab; [SerializeField] private GameObject spilledCornAnimationPrefab; - [SerializeField] private GameObject missCornAnimationPrefab; - [SerializeField] private CornMissMeter cornMissMeter; - [SerializeField] private RectTransform missTextSpawnTransform; - private static readonly Bounds missEffectBounds = new Bounds(new Vector3(0f, 1.7f), new Vector3(10f, 7f)); - [SerializeField] private int cornSpawnCount = 20; [SerializeField] private int maxFailedCornCount = 10; [SerializeField, ReadOnly] private float baseGrowSpeed = 1f; @@ -124,7 +119,6 @@ public class CornManager : MonoBehaviour { cornGrowSpeed.Value = 0f; missCount.Value = 0; - cornMissMeter.ResetMeter(); isCompleted = false; compositeDisposable.Clear(); cornConditions.Clear(); @@ -264,27 +258,6 @@ public class CornManager : MonoBehaviour this.CallWaitForSeconds(1.5f, () => Destroy(animation)); } - private void SpawnMissAnimation(CornCondition condition) - { - // ミス表示 - var position = new Vector2(Random.Range(missEffectBounds.min.x, missEffectBounds.max.x), Random.Range(missEffectBounds.min.y, missEffectBounds.max.y)); - var animation = Instantiate(missCornAnimationPrefab, position, Quaternion.identity, missTextSpawnTransform); - animation.GetComponent().ChangeSkin(condition); - - this.CallWaitForSeconds(.75f, () => - { - this.CallLerp(.2f, f => - { - animation.transform.position = Vector3.Lerp(position, cornMissMeter.transform.position, f.EaseInCubic()); - }, () => - { - VibrationManager.Instance.PlayVibrationOnce(); - cornMissMeter.SetMeter((float)missCount.Value/maxFailedCornCount); - Destroy(animation); - }); - }); - } - private void SetResult(CornResult resultValue) { cornGrowSpeed.Value = 0f; From b909bbd4f04dbce40e63cb3e9e4688d6a54498ff Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 26 Jul 2021 10:09:53 +0900 Subject: [PATCH 2/9] =?UTF-8?q?=E9=A3=9B=E3=81=B3=E5=87=BA=E3=81=97?= =?UTF-8?q?=E6=BC=94=E5=87=BA=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/Cooking/Cooking.unity | 16 ------------- .../MyGame/Scenes/Cooking/Prefabs/corn.prefab | 5 ++++ .../MyGame/Scenes/Cooking/Scripts/Corn.cs | 24 ++++++++++++++----- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Cooking.unity b/popcorn/Assets/MyGame/Scenes/Cooking/Cooking.unity index f2f8d88e..9e771bbf 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Cooking.unity +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Cooking.unity @@ -8914,10 +8914,6 @@ MonoBehaviour: type: 3} spilledCornAnimationPrefab: {fileID: 2449901118440757730, guid: 7e7fbf241bd7f461fb46363ff0c6be3e, type: 3} - missCornAnimationPrefab: {fileID: 4156092651619109751, guid: 59ad9ca2628fc4f9d8f03900854207ac, - type: 3} - cornMissMeter: {fileID: 1871878300} - missTextSpawnTransform: {fileID: 676036207} cornSpawnCount: 50 maxFailedCornCount: 25 baseGrowSpeed: 1 @@ -8943,18 +8939,6 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 8509883328564265099} m_PrefabAsset: {fileID: 0} ---- !u!114 &1871878300 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 4080947763864399562, guid: 1a47fa9bdeb434bffa410f731816203f, - type: 3} - m_PrefabInstance: {fileID: 8509883328564265099} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2537d840e3a243a1883f1c5289412fd9, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &1928679189 GameObject: m_ObjectHideFlags: 0 diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Prefabs/corn.prefab b/popcorn/Assets/MyGame/Scenes/Cooking/Prefabs/corn.prefab index f59b51f8..b0544ed8 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Prefabs/corn.prefab +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Prefabs/corn.prefab @@ -70,6 +70,11 @@ MonoBehaviour: cornSkin: {fileID: 7130900939474693981} effectBurnt: {fileID: 3984349228049242719, guid: 02298b5aac4434a4c81aec58ad2caa9d, type: 3} + effectSpillSeed: {fileID: 5078088515886692167, guid: 6e11516cabfc8450593dee19282ddd0d, + type: 3} + effectSpillPopped: {fileID: 4783546067326661837, guid: b66901098e7af4bd483c1dda2a423941, + type: 3} + burntMaterial: {fileID: 2100000, guid: bec51957e6eb5467abd3d46dc72f642a, type: 2} animator: {fileID: 5972257590091015193} --- !u!50 &7195010600253370228 Rigidbody2D: diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs index 4d47ba60..8f911f80 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs @@ -22,6 +22,9 @@ public class Corn : MonoBehaviour [SerializeField] private CornSkin cornSkin; [SerializeField] private GameObject effectBurnt; + [SerializeField] private GameObject effectSpillSeed; + [SerializeField] private GameObject effectSpillPopped; + [SerializeField] private Material burntMaterial; [SerializeField] private Animator animator; private Rigidbody2D rigidbody; @@ -68,12 +71,21 @@ public class Corn : MonoBehaviour .Subscribe(_ => { spilled.Value = true; - var clone = Instantiate(cornSkin); - clone.ChangeSkin(condition.Value); - var cloneRigidBody = clone.gameObject.AddComponent(); - cloneRigidBody.gravityScale = 0; - cloneRigidBody.AddForce(rigidbody.velocity.normalized * 20f, ForceMode2D.Impulse); - this.CallWaitForSeconds(2f, () => Destroy(clone.gameObject)); + GameObject effect; + if (condition.Value == CornCondition.Seed) + { + effect = Instantiate(effectSpillSeed, transform.position, Quaternion.identity, null); + this.CallWaitForSeconds(5f, () => Destroy(effect)); + } + else + { + effect = Instantiate(effectSpillPopped, transform.position, Quaternion.identity, null); + if (condition.Value == CornCondition.Burnt) + { + effect.transform.GetChild(0).GetComponentInChildren().material = burntMaterial; + } + this.CallWaitForSeconds(5f, () => Destroy(effect)); + } }).AddTo(this); condition.Pairwise().Subscribe(x => From 683d6fe837a440b5899e95734839f92de6e3f432 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 26 Jul 2021 11:55:11 +0900 Subject: [PATCH 3/9] =?UTF-8?q?=E3=83=91=E3=83=BC=E3=83=86=E3=82=A3?= =?UTF-8?q?=E3=82=AF=E3=83=AB=E5=90=91=E3=81=8D=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Resource/Effect/EffectPrefabs/pt_Corn.prefab | 6 +++--- .../MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn.prefab | 6 +++--- .../Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Corn.prefab b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Corn.prefab index 169445a9..86678224 100644 --- a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Corn.prefab +++ b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Corn.prefab @@ -25,14 +25,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5078088515886692167} - m_LocalRotation: {x: -0, y: -0, z: 0.42941898, w: 0.90310544} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 2.66, y: 2.9, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 5078088516399480976} m_Father: {fileID: 0} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!198 &5078088515886692165 ParticleSystem: m_ObjectHideFlags: 0 @@ -5479,7 +5479,7 @@ ParticleSystem: radiusThickness: 1 donutRadius: 0.2 m_Position: {x: 0, y: 0, z: 0} - m_Rotation: {x: 0, y: 0, z: 0} + m_Rotation: {x: 0, y: 0, z: 50} m_Scale: {x: 1, y: 1, z: 1} placementMode: 0 m_MeshMaterialIndex: 0 diff --git a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn.prefab b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn.prefab index 9bd2d928..1d611cab 100644 --- a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn.prefab +++ b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn.prefab @@ -666,7 +666,7 @@ ParticleSystem: radiusThickness: 1 donutRadius: 0.2 m_Position: {x: 0, y: 0, z: 0} - m_Rotation: {x: 0, y: 0, z: 0} + m_Rotation: {x: 0, y: 0, z: 50} m_Scale: {x: 1, y: 1, z: 1} placementMode: 0 m_MeshMaterialIndex: 0 @@ -4837,14 +4837,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4783546067326661837} - m_LocalRotation: {x: -0, y: -0, z: 0.42941898, w: 0.90310544} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 2.66, y: 2.9, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4783546067082268243} m_Father: {fileID: 0} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!198 &4783546067326661839 ParticleSystem: m_ObjectHideFlags: 0 diff --git a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab index 1f5efa22..1fd912fd 100644 --- a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab +++ b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab @@ -9694,14 +9694,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7516975307168929492} - m_LocalRotation: {x: -0, y: -0, z: 0.42941898, w: 0.90310544} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 2.66, y: 2.9, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 7516975307813098670} m_Father: {fileID: 0} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!198 &7516975307168929494 ParticleSystem: m_ObjectHideFlags: 0 @@ -15151,7 +15151,7 @@ ParticleSystem: radiusThickness: 0 donutRadius: 0.2 m_Position: {x: 0, y: 0, z: 0} - m_Rotation: {x: 0, y: 0, z: 0} + m_Rotation: {x: 0, y: 0, z: 50} m_Scale: {x: 1, y: 1, z: 1} placementMode: 0 m_MeshMaterialIndex: 0 From 09abcff7aa5a42ad102f909abb84e56921836eaf Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 26 Jul 2021 11:55:46 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=E3=83=91=E3=83=BC=E3=83=86=E3=82=A3?= =?UTF-8?q?=E3=82=AF=E3=83=AB=E3=82=B9=E3=82=AD=E3=83=B3=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E5=87=A6=E7=90=86=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EffectPrefabs/pt_Popcorn_strike.prefab | 19 +++++ ...opcorn_unfinished_burnt_failure_Dither.mat | 77 +++++++++++++++++++ ...n_unfinished_burnt_failure_Dither.mat.meta | 8 ++ .../MyGame/Scenes/Cooking/Cooking.unity | 2 +- .../Scenes/Cooking/Scripts/CornManager.cs | 2 +- .../Cooking/Scripts/PopcornStrikeEffect.cs | 22 ++++++ .../Scripts/PopcornStrikeEffect.cs.meta | 3 + 7 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 popcorn/Assets/MyGame/Resource/Material/popcorn/popcorn_unfinished_burnt_failure_Dither.mat create mode 100644 popcorn/Assets/MyGame/Resource/Material/popcorn/popcorn_unfinished_burnt_failure_Dither.mat.meta create mode 100644 popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornStrikeEffect.cs create mode 100644 popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornStrikeEffect.cs.meta diff --git a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab index 1fd912fd..2f91c247 100644 --- a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab +++ b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab @@ -9680,6 +9680,7 @@ GameObject: - component: {fileID: 7516975307168929495} - component: {fileID: 7516975307168929494} - component: {fileID: 7516975307168929493} + - component: {fileID: 721213865261247925} m_Layer: 0 m_Name: pt_Popcorn_strike m_TagString: Untagged @@ -14482,6 +14483,24 @@ ParticleSystemRenderer: m_Mesh2: {fileID: 0} m_Mesh3: {fileID: 0} m_MaskInteraction: 0 +--- !u!114 &721213865261247925 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7516975307168929492} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0125090276d945c2bb856fd440fdff6b, type: 3} + m_Name: + m_EditorClassIdentifier: + particleRenderA: {fileID: 7516975307813098671} + particleRenderB: {fileID: 7516975307116267766} + particleRenderC: {fileID: 7516975306867202139} + burntMaterialA: {fileID: 2100000, guid: bec51957e6eb5467abd3d46dc72f642a, type: 2} + burntMaterialB: {fileID: 2100000, guid: cea7e196dbc8d4a4a8b8540ce7a2410f, type: 2} + burntMaterialC: {fileID: 2100000, guid: 036c01b6cfb3f425e9b48f183b100571, type: 2} --- !u!1 &7516975307813098669 GameObject: m_ObjectHideFlags: 0 diff --git a/popcorn/Assets/MyGame/Resource/Material/popcorn/popcorn_unfinished_burnt_failure_Dither.mat b/popcorn/Assets/MyGame/Resource/Material/popcorn/popcorn_unfinished_burnt_failure_Dither.mat new file mode 100644 index 00000000..b6273b78 --- /dev/null +++ b/popcorn/Assets/MyGame/Resource/Material/popcorn/popcorn_unfinished_burnt_failure_Dither.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: popcorn_unfinished_burnt_failure_Dither + m_Shader: {fileID: 10721, 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: 2800000, guid: 8d287beb744ac6b458a3088ac499a1dd, type: 3} + 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.5 + - _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} diff --git a/popcorn/Assets/MyGame/Resource/Material/popcorn/popcorn_unfinished_burnt_failure_Dither.mat.meta b/popcorn/Assets/MyGame/Resource/Material/popcorn/popcorn_unfinished_burnt_failure_Dither.mat.meta new file mode 100644 index 00000000..b622c350 --- /dev/null +++ b/popcorn/Assets/MyGame/Resource/Material/popcorn/popcorn_unfinished_burnt_failure_Dither.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cea7e196dbc8d4a4a8b8540ce7a2410f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Cooking.unity b/popcorn/Assets/MyGame/Scenes/Cooking/Cooking.unity index 9e771bbf..9d24a6cf 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Cooking.unity +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Cooking.unity @@ -8912,7 +8912,7 @@ MonoBehaviour: cornSpawnTarget: {fileID: 1440136003} cornPrefab: {fileID: 5499754490129207122, guid: 2b790fd908bd14de4a601c21374fb55b, type: 3} - spilledCornAnimationPrefab: {fileID: 2449901118440757730, guid: 7e7fbf241bd7f461fb46363ff0c6be3e, + spilledCornAnimationPrefab: {fileID: 7516975307168929492, guid: 33c91c454a38e410cb291f1f2e5756cc, type: 3} cornSpawnCount: 50 maxFailedCornCount: 25 diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs index dd7fe019..3e9a2bd0 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs @@ -253,7 +253,7 @@ public class CornManager : MonoBehaviour // 画面KO再生 var animation = Instantiate(spilledCornAnimationPrefab, position, Quaternion.identity); // KOコーンスキン変更 - animation.GetComponent().ChangeCornSkin(condition); + animation.GetComponent().ChangeSkin(condition); VibrationManager.Instance.PlayVibrationDoubleStrong(); this.CallWaitForSeconds(1.5f, () => Destroy(animation)); } diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornStrikeEffect.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornStrikeEffect.cs new file mode 100644 index 00000000..97eb70d7 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornStrikeEffect.cs @@ -0,0 +1,22 @@ +using System; +using UnityEngine; + +public class PopcornStrikeEffect : MonoBehaviour +{ + [SerializeField] private ParticleSystemRenderer particleRenderA; + [SerializeField] private ParticleSystemRenderer particleRenderB; + [SerializeField] private ParticleSystemRenderer particleRenderC; + [SerializeField] private Material burntMaterialA; + [SerializeField] private Material burntMaterialB; + [SerializeField] private Material burntMaterialC; + + public void ChangeSkin(CornCondition condition) + { + if (condition == CornCondition.Burnt) + { + particleRenderA.material = burntMaterialA; + particleRenderB.material = burntMaterialB; + particleRenderC.material = burntMaterialC; + } + } +} diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornStrikeEffect.cs.meta b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornStrikeEffect.cs.meta new file mode 100644 index 00000000..dd4f1f27 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornStrikeEffect.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0125090276d945c2bb856fd440fdff6b +timeCreated: 1627263716 \ No newline at end of file From 77cafee960d68d214850149f8a2c2d11fe0da890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B4=E8=B0=B7=E5=9C=AD=E5=90=BE?= Date: Mon, 26 Jul 2021 11:59:39 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E6=BB=91=E3=82=8A=E3=82=84=E3=81=99=E3=81=95=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popcorn/Assets/MyGame/Scenes/Cooking/Prefabs/corn.prefab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Prefabs/corn.prefab b/popcorn/Assets/MyGame/Scenes/Cooking/Prefabs/corn.prefab index f59b51f8..f1b98994 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Prefabs/corn.prefab +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Prefabs/corn.prefab @@ -84,7 +84,7 @@ Rigidbody2D: m_UseFullKinematicContacts: 0 m_UseAutoMass: 0 m_Mass: 1 - m_LinearDrag: 3 + m_LinearDrag: 3.5 m_AngularDrag: 2 m_GravityScale: 0 m_Material: {fileID: 6200000, guid: 1e68e56cd6ac4484ba25eb760e0d3057, type: 2} From faa5e8f569ec48ee3c6b354cdb24bda23e1b3835 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 26 Jul 2021 12:38:49 +0900 Subject: [PATCH 6/9] =?UTF-8?q?=E6=BC=94=E5=87=BA=E7=B5=84=E3=81=BF?= =?UTF-8?q?=E8=BE=BC=E3=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/Cooking/Scripts/Corn.cs | 2 +- .../Scenes/Cooking/Scripts/CornManager.cs | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs index 8f911f80..ea55a2c2 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Corn.cs @@ -66,7 +66,7 @@ public class Corn : MonoBehaviour this.ObserveEveryValueChanged(x => x.rigidbody.velocity.magnitude) .Where(x => x >= cornSpillSpeed) .ThrottleFirstFrame(30) // 30フレーム間隔開ける - .Select(_ => Random.value < .2f) // 演出を出す確率 + .Where(_ => Random.value < .2f) // 演出を出す確率 .FirstOrDefault() .Subscribe(_ => { diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs index 3e9a2bd0..3edcf9aa 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs @@ -39,7 +39,7 @@ public class CornManager : MonoBehaviour private bool isHot; private bool isCompleted; private readonly List> cornConditions = new List>(); - private readonly Subject cornSpilledSubject = new Subject(); + private readonly Subject<(CornCondition cond, Vector3 pos)> cornSpilledSubject = new Subject<(CornCondition, Vector3)>(); private readonly ReactiveProperty missCount = new ReactiveProperty(); private readonly ReactiveProperty cornGrowSpeed = new FloatReactiveProperty(0f); private readonly CompositeDisposable compositeDisposable = new CompositeDisposable(); @@ -72,13 +72,13 @@ public class CornManager : MonoBehaviour // コーン飛び出し制御 // 5フレームごとに2回など演出の回数を制御 cornSpilledSubject - .Where(x => x != CornCondition.Seed) // Seedは演出なし + .Where(x => x.cond != CornCondition.Seed) // Seedは演出なし .BatchFrame(5, FrameCountType.EndOfFrame) // 指定フレーム分まとめる .Subscribe(x => { - foreach (var condition in x.RandomChoose(2)) + foreach (var item in x.RandomChoose(2)) { - SpawnSpilledAnimation(condition); + SpawnSpilledAnimation(item.cond, item.pos); } }).AddTo(this); @@ -192,11 +192,7 @@ public class CornManager : MonoBehaviour }).AddTo(compositeDisposable); corn.Spilled - .Subscribe(_ => - { - // 同時に飛び出したとき用に演出をばらつかせる - corn.CallWaitForSeconds(Random.Range(0f, .5f), () => cornSpilledSubject.OnNext(corn.Condition.Value)); - }).AddTo(compositeDisposable); + .Subscribe(_ => cornSpilledSubject.OnNext((corn.Condition.Value, corn.transform.position))).AddTo(compositeDisposable); cornConditions.Add(corn.Condition); } @@ -246,10 +242,8 @@ public class CornManager : MonoBehaviour } } - private void SpawnSpilledAnimation(CornCondition condition) + private void SpawnSpilledAnimation(CornCondition condition, Vector3 position) { - // Result表示より下の範囲にランダム表示 - var position = new Vector2((Random.value * 2 - 1) * worldWidth, Mathf.Lerp(-worldHeight, maxSpilledHeight, Random.value)); // 画面KO再生 var animation = Instantiate(spilledCornAnimationPrefab, position, Quaternion.identity); // KOコーンスキン変更 From d1fccc463b281b020644738c723b134883112c1d Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 26 Jul 2021 12:39:07 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E5=87=A6=E7=90=86?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs index 3edcf9aa..64286062 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs @@ -32,9 +32,6 @@ public class CornManager : MonoBehaviour public IReadOnlyReactiveProperty Result => result; private readonly ReactiveProperty result = new ReactiveProperty(); - private float worldWidth; - private float worldHeight; - private static readonly float maxSpilledHeight = 4f; private Corn[] cornArray; private bool isHot; private bool isCompleted; @@ -58,9 +55,6 @@ public class CornManager : MonoBehaviour private void Awake() { - var leftTop = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, 0)); - worldWidth = leftTop.x; - worldHeight = leftTop.y; cornArray = new Corn[cornSpawnCount]; result.AddTo(this); cornGrowSpeed.AddTo(this); From 7994d4ad104cd134c7ee72b4eba36064d2f728e3 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 26 Jul 2021 13:19:46 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E5=AE=8C=E6=88=90/=E7=84=A6=E3=81=92=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=9F=E3=83=B3=E3=82=B0=E3=82=92=E9=85=8D=E5=88=97=E3=81=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/Cooking/Scripts/CornManager.cs | 17 +-- .../Cooking/Scripts/CornPopParameters.cs | 108 ++++++++++++++++++ .../Cooking/Scripts/CornPopParameters.cs.meta | 3 + 3 files changed, 112 insertions(+), 16 deletions(-) create mode 100644 popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornPopParameters.cs create mode 100644 popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornPopParameters.cs.meta diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs index 64286062..a11432d0 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornManager.cs @@ -126,26 +126,11 @@ public class CornManager : MonoBehaviour cornArray = new Corn[cornSpawnCount]; // コーン生成 - var popTime = 1f; for (int i = 0; i < cornSpawnCount; i++) { - // コーン生成テーブル - if (1 <= i && i <= 5) - { - popTime += 3 - (i - 1) * .5f; - } - else if (6 <= i && i <= 10) - { - popTime += 0.5f - (i - 6) * .1f; - } - else if (11 <= i) - { - popTime += .1f; - } - var corn = Instantiate(cornPrefab, cornSpawnTarget); cornArray[i] = corn; - corn.SetCornProperty(popTime, cornBurntDuration + Random.Range(0, cornBurntRandom), cornSpillSpeed, cornPopSpeed); + corn.SetCornProperty( CornPopParameters.CornPopTimeArray[i], CornPopParameters.CornBurntTimeArray[i], cornSpillSpeed, cornPopSpeed); // 進行速度の変更時、コーン速度変更 cornGrowSpeed.TakeWhile(_ => !isCompleted).Subscribe(x => { diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornPopParameters.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornPopParameters.cs new file mode 100644 index 00000000..8d80725e --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornPopParameters.cs @@ -0,0 +1,108 @@ +public class CornPopParameters +{ + public static readonly float[] CornPopTimeArray = { + 1f, + 4f, + 6.5f, + 8.5f, + 10f, + 11f, + 11.5f, + 11.9f, + 12.2f, + 12.4f, + 12.5f, + 12.6f, + 12.7f, + 12.8f, + 12.9f, + 13f, + 13.1f, + 13.2f, + 13.3f, + 13.4f, + 13.5f, + 13.6f, + 13.7f, + 13.8f, + 13.9f, + 14f, + 14.1f, + 14.2f, + 14.3f, + 14.4f, + 14.5f, + 14.6f, + 14.7f, + 14.8f, + 14.9f, + 15f, + 15.1f, + 15.2f, + 15.3f, + 15.4f, + 15.5f, + 15.6f, + 15.7f, + 15.8f, + 15.9f, + 16f, + 16.1f, + 16.2f, + 16.3f, + 16.4f, + }; + + public static readonly float[] CornBurntTimeArray = { + 7.6f, + 6.085f, + 4.82f, + 3.805f, + 3.04f, + 2.525f, + 2.26f, + 2.045f, + 1.88f, + 1.765f, + 1.7f, + 1.635f, + 1.57f, + 1.505f, + 1.44f, + 1.375f, + 1.31f, + 1.245f, + 1.18f, + 1.115f, + 1.05f, + 0.985f, + 0.92f, + 0.855f, + 0.8f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + 1.5f, + }; +} \ No newline at end of file diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornPopParameters.cs.meta b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornPopParameters.cs.meta new file mode 100644 index 00000000..17aa7a22 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CornPopParameters.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4a39eee460c642d5a761191849b7ff22 +timeCreated: 1627272430 \ No newline at end of file From 36aea7cb1513158ec71a29e789df71d31ef3f913 Mon Sep 17 00:00:00 2001 From: hirokei Date: Mon, 26 Jul 2021 13:22:21 +0900 Subject: [PATCH 9/9] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=B3=E5=BC=BE?= =?UTF-8?q?=E3=81=91=E3=82=8B=E3=82=A8=E3=83=95=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resource/Effect/EffectPrefabs/pt_Corn.prefab | 10 +++++----- .../Resource/Effect/EffectPrefabs/pt_Popcorn.prefab | 10 +++++----- .../Effect/EffectPrefabs/pt_Popcorn_strike.prefab | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Corn.prefab b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Corn.prefab index 86678224..ce32c22a 100644 --- a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Corn.prefab +++ b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Corn.prefab @@ -116,7 +116,7 @@ ParticleSystem: startLifetime: serializedVersion: 2 minMaxState: 0 - scalar: 0.1 + scalar: 0.15 minScalar: 5 maxCurve: serializedVersion: 2 @@ -4789,7 +4789,7 @@ ParticleSystemRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 0 + m_SortingOrder: 5 m_RenderMode: 0 m_SortMode: 0 m_MinParticleSize: 0 @@ -4838,13 +4838,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5078088516399480977} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0.18903114, w: 0.98197114} m_LocalPosition: {x: 0.24, y: 0.2, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 5078088515886692164} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 50.861004} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: -21.792002} --- !u!198 &5078088516399480982 ParticleSystem: m_ObjectHideFlags: 0 @@ -5616,7 +5616,7 @@ ParticleSystem: m_PostInfinity: 2 m_RotationOrder: 4 arc: - value: 76.8 + value: 124.92 mode: 0 spread: 0 speed: diff --git a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn.prefab b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn.prefab index 1d611cab..2a0fc153 100644 --- a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn.prefab +++ b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn.prefab @@ -25,13 +25,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4783546067082268242} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0.21810172, w: 0.97592604} m_LocalPosition: {x: 0.24, y: 0.2, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4783546067326661872} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 50.861004} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: -25.195002} --- !u!198 &4783546067082268245 ParticleSystem: m_ObjectHideFlags: 0 @@ -803,7 +803,7 @@ ParticleSystem: m_PostInfinity: 2 m_RotationOrder: 4 arc: - value: 76.8 + value: 127.3 mode: 0 spread: 0 speed: @@ -4928,7 +4928,7 @@ ParticleSystem: startLifetime: serializedVersion: 2 minMaxState: 0 - scalar: 0.1 + scalar: 0.15 minScalar: 5 maxCurve: serializedVersion: 2 @@ -9601,7 +9601,7 @@ ParticleSystemRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 0 + m_SortingOrder: 5 m_RenderMode: 0 m_SortMode: 0 m_MinParticleSize: 0 diff --git a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab index 2f91c247..fe60c030 100644 --- a/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab +++ b/popcorn/Assets/MyGame/Resource/Effect/EffectPrefabs/pt_Popcorn_strike.prefab @@ -9786,7 +9786,7 @@ ParticleSystem: startLifetime: serializedVersion: 2 minMaxState: 0 - scalar: 0.1 + scalar: 0.15 minScalar: 5 maxCurve: serializedVersion: 2 @@ -14459,7 +14459,7 @@ ParticleSystemRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 0 + m_SortingOrder: 5 m_RenderMode: 0 m_SortMode: 0 m_MinParticleSize: 0