Jelajahi Sumber

Merge branch 'develop' into Hybrid-lvl-5s

x89rt2 2 bulan lalu
induk
melakukan
813a2a8d68
75 mengubah file dengan 1665 tambahan dan 1959 penghapusan
  1. 3 1
      Assets/AddOn/Shapes2D/Demos/Flappy Shapes/Bird.cs
  2. 4 3
      Assets/Effect/52SpecialEffectPack/EffectEditor/ShurikenEffectEditor/csShurikenEffectChanger.cs
  3. 1 1
      Assets/Effect/52SpecialEffectPack/EffectEditor/ShurikenEffectEditor/csShurikenEffectEditor.cs
  4. 103 0
      Assets/Scenes/Opening.unity
  5. 19 17
      Assets/Scripts/CardEffect/BT11/Purple/BT11_088.cs
  6. 0 5
      Assets/Scripts/CardEffect/BT15/Black/BT15_066.cs
  7. 3 1
      Assets/Scripts/CardEffect/BT15/Blue/BT15_029.cs
  8. 269 363
      Assets/Scripts/CardEffect/BT15/White/BT15_102.cs
  9. 2 1
      Assets/Scripts/CardEffect/BT16/Red/BT16_015.cs
  10. 25 0
      Assets/Scripts/CardEffect/BT19/Black/BT19_063.cs
  11. 19 37
      Assets/Scripts/CardEffect/BT20/Red/BT20_093.cs
  12. 131 411
      Assets/Scripts/CardEffect/BT21/Yellow/BT21_044.cs
  13. 2 2
      Assets/Scripts/CardEffect/BT22/Yellow/BT22_042.cs
  14. 5 3
      Assets/Scripts/CardEffect/BT25/Purple/BT25_080.cs
  15. 0 5
      Assets/Scripts/CardEffect/EX10/Black/EX10_035.cs
  16. 23 44
      Assets/Scripts/CardEffect/EX3/Yellow/EX3_069.cs
  17. 20 12
      Assets/Scripts/CardEffect/EX4/Green/EX4_063.cs
  18. 77 101
      Assets/Scripts/CardEffect/EX4/Purple/EX4_058.cs
  19. 29 39
      Assets/Scripts/CardEffect/EX4/Purple/EX4_071.cs
  20. 2 1
      Assets/Scripts/CardEffect/EX9/Black/EX9_057.cs
  21. 2 0
      Assets/Scripts/CardEffect/EX9/White/EX9_074.cs
  22. 4 6
      Assets/Scripts/CardEffect/P/Red/P_110.cs
  23. 0 5
      Assets/Scripts/CardEffect/P/Red/P_220.cs
  24. 43 0
      Assets/Scripts/Script/AnimatorExtensions.cs
  25. 11 0
      Assets/Scripts/Script/AnimatorExtensions.cs.meta
  26. 2 2
      Assets/Scripts/Script/AttackProcess.cs
  27. 7 4
      Assets/Scripts/Script/BreakGlass.cs
  28. 0 1
      Assets/Scripts/Script/CEntity_Base.cs
  29. 1 3
      Assets/Scripts/Script/CEntity_Effect.cs
  30. 31 25
      Assets/Scripts/Script/CardController.cs
  31. 19 21
      Assets/Scripts/Script/CardEffectCommons/DNADigivolveEffects.cs
  32. 4 7
      Assets/Scripts/Script/CardEffectFactory/KeyWordEffects/ArtsDigivolve.cs
  33. 1 1
      Assets/Scripts/Script/CardEffects/DisableEffectClass.cs
  34. 15 12
      Assets/Scripts/Script/CardImagePanel.cs
  35. 32 29
      Assets/Scripts/Script/CardPrefab_CreateDeck.cs
  36. 0 3
      Assets/Scripts/Script/CommandPanel.cs
  37. 291 327
      Assets/Scripts/Script/ContinuousController.cs
  38. 3 3
      Assets/Scripts/Script/DataBase.cs
  39. 6 6
      Assets/Scripts/Script/DeckInfoPanel.cs
  40. 6 7
      Assets/Scripts/Script/DeckListPanel.cs
  41. 36 36
      Assets/Scripts/Script/DetailCard_DeckEditor.cs
  42. 0 2
      Assets/Scripts/Script/DigiXrosEffectObject.cs
  43. 16 29
      Assets/Scripts/Script/EditDeck.cs
  44. 47 41
      Assets/Scripts/Script/Effects.cs
  45. 16 19
      Assets/Scripts/Script/EnterRoom.cs
  46. 2 0
      Assets/Scripts/Script/EvolutionEffectObject.cs
  47. 4 2
      Assets/Scripts/Script/GManager.cs
  48. 11 13
      Assets/Scripts/Script/GameplayOption.cs
  49. 6 7
      Assets/Scripts/Script/GraphicsOptionPanel.cs
  50. 0 2
      Assets/Scripts/Script/HideCannotSelectObject.cs
  51. 2 4
      Assets/Scripts/Script/HomeMode.cs
  52. 1 1
      Assets/Scripts/Script/ICardEffect.cs
  53. 7 5
      Assets/Scripts/Script/LanguagePanel.cs
  54. 23 21
      Assets/Scripts/Script/LobbyManager_RandomMatch.cs
  55. 14 12
      Assets/Scripts/Script/Opening.cs
  56. 5 3
      Assets/Scripts/Script/OptionPanel.cs
  57. 0 3
      Assets/Scripts/Script/OptionUtility.cs
  58. 0 7
      Assets/Scripts/Script/PatchNotes.cs
  59. 17 15
      Assets/Scripts/Script/Player.cs
  60. 48 49
      Assets/Scripts/Script/ResizeWindow.cs
  61. 33 36
      Assets/Scripts/Script/RoomManager.cs
  62. 4 4
      Assets/Scripts/Script/SelectAssemblyClass.cs
  63. 22 22
      Assets/Scripts/Script/SelectBattleDeck.cs
  64. 6 6
      Assets/Scripts/Script/SelectDNACondition.cs
  65. 11 10
      Assets/Scripts/Script/SelectDeck.cs
  66. 1 1
      Assets/Scripts/Script/SelectJogressEffect.cs
  67. 8 9
      Assets/Scripts/Script/ServerRegionPanel.cs
  68. 1 1
      Assets/Scripts/Script/SimpleCircleLayoutGroup.cs
  69. 2 2
      Assets/Scripts/Script/SpellRestoration.cs
  70. 3 3
      Assets/Scripts/Script/Title.cs
  71. 31 29
      Assets/Scripts/Script/TrialDraw.cs
  72. 21 18
      Assets/Scripts/Script/TurnStateMachine.cs
  73. 35 22
      Assets/Scripts/Script/UserSelectionManager.cs
  74. 10 9
      Assets/Scripts/Script/VolumePanel.cs
  75. 7 7
      Assets/Scripts/Script/YesNoObject.cs

+ 3 - 1
Assets/AddOn/Shapes2D/Demos/Flappy Shapes/Bird.cs

@@ -4,7 +4,9 @@
 	using System.Collections;
 	using UnityEngine.EventSystems;
 
-	public class Bird : MonoBehaviour {
+    [RequireComponent(typeof(Rigidbody2D))]
+    [RequireComponent(typeof(Animator))]
+    public class Bird : MonoBehaviour {
 
 		Rigidbody2D rb;
 		public float force = 8;

+ 4 - 3
Assets/Effect/52SpecialEffectPack/EffectEditor/ShurikenEffectEditor/csShurikenEffectChanger.cs

@@ -12,9 +12,10 @@ public class csShurikenEffectChanger : MonoBehaviour
         transform.localScale *= _Value;
 
 		foreach(ParticleSystem _ParticleSystem in ParticleSystems) {
-			_ParticleSystem.startSpeed *= _Value;
-			_ParticleSystem.startSize *= _Value;
-			_ParticleSystem.gravityModifier *= _Value;
+            var main = _ParticleSystem.main;
+            main.startSpeedMultiplier = _Value;
+			main.startSizeMultiplier = _Value;
+            main.gravityModifierMultiplier = _Value;
 			SerializedObject _SerializedObject = new SerializedObject(_ParticleSystem);
 			_SerializedObject.FindProperty("CollisionModule.particleRadius").floatValue *= _Value;
 			_SerializedObject.FindProperty("ShapeModule.radius").floatValue *= _Value;

+ 1 - 1
Assets/Effect/52SpecialEffectPack/EffectEditor/ShurikenEffectEditor/csShurikenEffectEditor.cs

@@ -19,7 +19,7 @@ public class csShurikenEffectEditor : EditorWindow
 	public static void Init()
 	{
         myWindow = EditorWindow.GetWindowWithRect<csShurikenEffectEditor>(new Rect(100, 100, 300, 220)); //set Editor Position and Size
-		myWindow.title = "Scale Editor";
+		myWindow.titleContent = new GUIContent("Scale Editor");
 	}
 
     void OnGUI()

+ 103 - 0
Assets/Scenes/Opening.unity

@@ -64666,6 +64666,7 @@ GameObject:
   - component: {fileID: 1576401445}
   - component: {fileID: 1576401446}
   - component: {fileID: 1576401447}
+  - component: {fileID: 1576401448}
   m_Layer: 5
   m_Name: DeckInfoPanel
   m_TagString: Untagged
@@ -64737,6 +64738,27 @@ MonoBehaviour:
   DeckCountText: {fileID: 1988002286}
   TrialDrawButton: {fileID: 5506376018178374681}
   isFromSelectDeck: 0
+--- !u!95 &1576401448
+Animator:
+  serializedVersion: 5
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1576401444}
+  m_Enabled: 1
+  m_Avatar: {fileID: 0}
+  m_Controller: {fileID: 9100000, guid: 89b572d6698ea714097bf5420918e98c, type: 2}
+  m_CullingMode: 0
+  m_UpdateMode: 0
+  m_ApplyRootMotion: 0
+  m_LinearVelocityBlending: 0
+  m_StabilizeFeet: 0
+  m_WarningMessage: 
+  m_HasTransformHierarchy: 1
+  m_AllowConstantClipSamplingOptimization: 1
+  m_KeepAnimatorStateOnDisable: 0
+  m_WriteDefaultValuesOnDisable: 0
 --- !u!1 &1582264489
 GameObject:
   m_ObjectHideFlags: 0
@@ -72852,6 +72874,7 @@ GameObject:
   - component: {fileID: 1792775834}
   - component: {fileID: 1792775836}
   - component: {fileID: 1792775835}
+  - component: {fileID: 1792775837}
   m_Layer: 5
   m_Name: DeckInfoPanel
   m_TagString: Untagged
@@ -72923,6 +72946,27 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 1792775833}
   m_CullTransparentMesh: 0
+--- !u!95 &1792775837
+Animator:
+  serializedVersion: 5
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1792775833}
+  m_Enabled: 1
+  m_Avatar: {fileID: 0}
+  m_Controller: {fileID: 0}
+  m_CullingMode: 0
+  m_UpdateMode: 0
+  m_ApplyRootMotion: 0
+  m_LinearVelocityBlending: 0
+  m_StabilizeFeet: 0
+  m_WarningMessage: 
+  m_HasTransformHierarchy: 1
+  m_AllowConstantClipSamplingOptimization: 1
+  m_KeepAnimatorStateOnDisable: 0
+  m_WriteDefaultValuesOnDisable: 0
 --- !u!1 &1795074585
 GameObject:
   m_ObjectHideFlags: 0
@@ -89882,6 +89926,7 @@ GameObject:
   - component: {fileID: 2123878073}
   - component: {fileID: 2123878075}
   - component: {fileID: 2123878074}
+  - component: {fileID: 2123878076}
   m_Layer: 5
   m_Name: DeckInfoPanel
   m_TagString: Untagged
@@ -89953,6 +89998,27 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 2123878072}
   m_CullTransparentMesh: 0
+--- !u!95 &2123878076
+Animator:
+  serializedVersion: 5
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2123878072}
+  m_Enabled: 1
+  m_Avatar: {fileID: 0}
+  m_Controller: {fileID: 0}
+  m_CullingMode: 0
+  m_UpdateMode: 0
+  m_ApplyRootMotion: 0
+  m_LinearVelocityBlending: 0
+  m_StabilizeFeet: 0
+  m_WarningMessage: 
+  m_HasTransformHierarchy: 1
+  m_AllowConstantClipSamplingOptimization: 1
+  m_KeepAnimatorStateOnDisable: 0
+  m_WriteDefaultValuesOnDisable: 0
 --- !u!1 &2125303686
 GameObject:
   m_ObjectHideFlags: 0
@@ -105731,6 +105797,7 @@ GameObject:
   - component: {fileID: 7827412352382397946}
   - component: {fileID: 7827412352382397944}
   - component: {fileID: 7827412352382397945}
+  - component: {fileID: 7827412352382397950}
   m_Layer: 5
   m_Name: DeckInfoPanel
   m_TagString: Untagged
@@ -105738,6 +105805,27 @@ GameObject:
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
   m_IsActive: 1
+--- !u!95 &7827412352382397950
+Animator:
+  serializedVersion: 5
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7827412352382397949}
+  m_Enabled: 1
+  m_Avatar: {fileID: 0}
+  m_Controller: {fileID: 0}
+  m_CullingMode: 0
+  m_UpdateMode: 0
+  m_ApplyRootMotion: 0
+  m_LinearVelocityBlending: 0
+  m_StabilizeFeet: 0
+  m_WarningMessage: 
+  m_HasTransformHierarchy: 1
+  m_AllowConstantClipSamplingOptimization: 1
+  m_KeepAnimatorStateOnDisable: 0
+  m_WriteDefaultValuesOnDisable: 0
 --- !u!222 &7827412352585523691
 CanvasRenderer:
   m_ObjectHideFlags: 0
@@ -106837,6 +106925,7 @@ GameObject:
   - component: {fileID: 7827412352956199575}
   - component: {fileID: 7827412352956199570}
   - component: {fileID: 7827412352956199571}
+  - component: {fileID: 7827412352956199576}
   m_Layer: 0
   m_Name: Opening
   m_TagString: Untagged
@@ -106859,6 +106948,20 @@ MonoBehaviour:
   playerInfo: {fileID: 7827412351893259071}
   loadingObject: {fileID: 1378047648}
   UpdateButtonParent: {fileID: 0}
+--- !u!114 &7827412352956199576
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7827412352956199574}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: f2a696ce2a233204c9fc6c9d84bf9750, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  URL: 
+  HashTacgs: []
 --- !u!222 &7827412353023664826
 CanvasRenderer:
   m_ObjectHideFlags: 0

+ 19 - 17
Assets/Scripts/CardEffect/BT11/Purple/BT11_088.cs

@@ -2,6 +2,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
+// Bagramon
 namespace DCGO.CardEffects.BT11
 {
     public class BT11_088 : CEntity_Effect
@@ -390,23 +391,24 @@ namespace DCGO.CardEffects.BT11
                             SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                             selectCardEffect.SetUp(
-                                        canTargetCondition: CanSelectCardCondition,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: CanEndSelectCondition,
-                                        canNoSelect: () => false,
-                                        selectCardCoroutine: SelectCardCoroutine,
-                                        afterSelectCardCoroutine: null,
-                                        message: "Select 1 digivolution card to discard.",
-                                        maxCount: 1,
-                                        canEndNotMax: false,
-                                        isShowOpponent: true,
-                                        mode: SelectCardEffect.Mode.Custom,
-                                        root: SelectCardEffect.Root.Custom,
-                                        customRootCardList: card.PermanentOfThisCard().DigivolutionCards,
-                                        canLookReverseCard: true,
-                                        selectPlayer: card.Owner,
-                                        cardEffect: null);
+                                canTargetCondition: CanSelectCardCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: CanEndSelectCondition,
+                                canNoSelect: () => false,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                message: "Select 1 digivolution card to discard.",
+                                maxCount: 1,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                mode: SelectCardEffect.Mode.Custom,
+                                root: SelectCardEffect.Root.DigivolutionCards,
+                                customRootCardList: card.PermanentOfThisCard().DigivolutionCards,
+                                canLookReverseCard: true,
+                                selectPlayer: card.Owner,
+                                cardEffect: null);
 
+                            selectCardEffect.SetUseFaceDown();
                             selectCardEffect.SetUpCustomMessage("Select 1 digivolution card to discard.", "The opponent is selecting 1 digivolution card to discard.");
 
                             yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
@@ -570,4 +572,4 @@ namespace DCGO.CardEffects.BT11
             return cardEffects;
         }
     }
-}
+}

+ 0 - 5
Assets/Scripts/CardEffect/BT15/Black/BT15_066.cs

@@ -58,11 +58,6 @@ namespace DCGO.CardEffects.BT15
                 return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
             }
 
-            bool SharedCanActivateCondition(Hashtable hashtable)
-            {
-                return CardEffectCommons.IsExistOnBattleArea(card);
-            }
-
             IEnumerator SharedActivateCoroutine(Hashtable _hashtable, ActivateClass activateClass)
             {
                 if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))

+ 3 - 1
Assets/Scripts/CardEffect/BT15/Blue/BT15_029.cs

@@ -60,6 +60,7 @@ namespace DCGO.CardEffects.BT15
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Place 1 Digimon card to digivolution cards to return 1 of your opponent's Digimon whose level is less than or equal to the placed card's level to the bottom of the deck.", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateSharedCondition, ActivateCoroutine, -1, true, EffectSharedDiscription());
+                activateClass.SetIsDigimonEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectSharedDiscription()
@@ -155,6 +156,7 @@ namespace DCGO.CardEffects.BT15
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Place 1 Digimon card to digivolution cards to return 1 of your opponent's Digimon whose level is less than or equal to the placed card's level to the bottom of the deck.", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateSharedCondition, ActivateCoroutine, -1, true, EffectSharedDiscription());
+                activateClass.SetIsDigimonEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectSharedDiscription()
@@ -342,4 +344,4 @@ namespace DCGO.CardEffects.BT15
             return cardEffects;
         }
     }
-}
+}

+ 269 - 363
Assets/Scripts/CardEffect/BT15/White/BT15_102.cs

@@ -3,6 +3,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
+// Apocalymon
 namespace DCGO.CardEffects.BT15
 {
     public class BT15_102 : CEntity_Effect
@@ -12,132 +13,186 @@ namespace DCGO.CardEffects.BT15
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region Before Pay Cost - Condition Effect
-
             if (timing == EffectTiming.BeforePayCost)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Placing 1 [Dark Masters] to get Play Cost -4", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 activateClass.SetHashString("PlayCost-12_BT15_102");
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
                     return "When this card would be played, by placing up to 3 [Dark Masters] trait cards with different names from your battle area or trash under it, reduce the play cost by 4 for each one.";
                 }
 
-                bool CanSelectCardCondition(CardSource cardSource)
+                bool CardCondition(CardSource cardSource)
                 {
-                    if (cardSource.IsDigimon)
-                    {
-                        if (cardSource.CardTraits.Contains("Dark Masters") || cardSource.CardTraits.Contains("DarkMasters"))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return cardSource == card;
                 }
 
-                bool CanSelectCardConditionPermenant(Permanent permanent)
+                bool CanNoSelect(CardSource cardSource, int placed)
                 {
-                    if (permanent.IsDigimon)
+                    if (cardSource != null
+                    && cardSource.PayingCost(SelectCardEffect.Root.Hand, null, checkAvailability: false) - (4 * placed) > cardSource.Owner.MaxMemoryCost)
                     {
-                        if (permanent.TopCard.ContainsTraits("Dark Masters") || permanent.TopCard.ContainsTraits("DarkMasters"))
-                        {
-                            return true;
-                        }
+                        return false;
                     }
-                    return false;
+
+                    return true;
                 }
 
-                bool CardCondition(CardSource cardSource)
+                bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (cardSource == card)
-                    {
-                        if (CardEffectCommons.IsExistOnHand(cardSource))
-                        {
-                            return true;
-                        }
-                    }
+                    return CardEffectCommons.CanTriggerWhenPermanentWouldPlay(hashtable, CardCondition);
+                }
+
+                bool IsDarkMaster(CardSource cardSource) => cardSource.EqualsTraits("Dark Masters");
 
-                    return false;
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsDarkMaster)
+                            || CardEffectCommons.HasMatchConditionOwnersPermanent(card, permanent => IsDarkMaster(permanent.TopCard));
                 }
 
-                bool CanNoSelect(CardSource cardSource)
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    if (cardSource != null)
+                    #region Shared bool and stuff
+                    List<CardSource> digivolutionCards = new List<CardSource>();
+
+                    bool CanSelectCardCondition(CardSource cardSource)
                     {
-                        if (cardSource.PayingCost(SelectCardEffect.Root.Hand, null, checkAvailability: false) > cardSource.Owner.MaxMemoryCost)
+                        if (IsDarkMaster(cardSource))
                         {
-                            return false;
+                            List<CardSource> chosenCards = digivolutionCards.Clone();
+                            chosenCards.Add(cardSource);
+
+                            return Combinations.GetUniqueNameCardCount(chosenCards) == chosenCards.Count;// If the highest unique names does not match the number of cards in the list, something shares a name
                         }
-                    }
 
-                    return true;
-                }
+                        return false;
+                    }
 
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    if (CardEffectCommons.CanTriggerWhenPermanentWouldPlay(hashtable, CardCondition))
+                    bool CanSelectPermanentCondition(Permanent permanent)
                     {
-                        return true;
+                        return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
+                            && CanSelectCardCondition(permanent.TopCard);
                     }
 
-                    return false;
-                }
+                    int validPermanentCount = CardEffectCommons.MatchConditionOwnersPermanentCount(card, CanSelectPermanentCondition);
+                    int validTrashCardCount = card.Owner.TrashCards.Count(CanSelectCardCondition);
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    if (CardEffectCommons.IsExistOnHand(card))
+                    int toPlace = Math.Min(3, validPermanentCount + validTrashCardCount);
+
+                    bool noSelect() => CanNoSelect(card, digivolutionCards.Count);
+
+                    bool ValidPermanentCombination(List<Permanent> permanents, Permanent permanent)
                     {
-                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
-                        {
-                            return true;
-                        }
+                        List<CardSource> chosenCards = permanents.Map(perm => perm.TopCard);
+                        chosenCards.Add(permanent.TopCard);
 
-                        if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectCardConditionPermenant))
-                        {
-                            return true;
-                        }
+                        return ValidCardCombination(chosenCards);
                     }
 
-                    return false;
-                }
+                    bool ValidCardSourceCombination(List<CardSource> cardSources, CardSource cardSource)
+                    {
+                        List<CardSource> chosenCards = cardSources.Clone();
+                        chosenCards.Add(cardSource);
 
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
-                {
-                    List<CardSource> digivolutionCards = new List<CardSource>();
+                        return ValidCardCombination(chosenCards);
+                    }
 
-                    bool CanSelectTrashCardCondition(CardSource cardSource)
+                    bool ValidCardCombination(List<CardSource> cardSources)
                     {
-                        if (CanSelectCardCondition(cardSource))
+                        List<CardSource> chosenCards = digivolutionCards.Clone();
+                        chosenCards.AddRange(cardSources);
+
+                        return Combinations.GetUniqueNameCardCount(chosenCards) == chosenCards.Count;// If the highest unique names does not match the number of cards in the list, something shares a name
+                    }
+                    #endregion
+
+                    while (toPlace > 0)
+                    {
+                        if (validPermanentCount > 0 && validTrashCardCount > 0)
                         {
-                            if (digivolutionCards.Count((filteredCard) => filteredCard.CardID == cardSource.CardID) == 0)
+                            List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>()
                             {
-                                return true;
+                                new(message: "from Battle Area", value: 1, spriteIndex: 0),
+                                new(message: "from Trash", value: 2, spriteIndex: 0)
+                            };
+
+                            if (noSelect())
+                            {
+                                string message = digivolutionCards.Count > 0 ? "Finish Placing" : "Do not place";
+                                selectionElements.Add(new(message: message, value: 3, spriteIndex: 1));
                             }
+
+                            GManager.instance.userSelectionManager.SetIntSelection(
+                                selectionElements: selectionElements,
+                                selectPlayer: card.Owner,
+                                selectPlayerMessage: "From which area will you select a card?",
+                                notSelectPlayerMessage: "The opponent is choosing from which area to select a card.");
+                        }
+                        else
+                        {
+                            GManager.instance.userSelectionManager.SetInt(validPermanentCount > 0 ? 1 : 2);
                         }
 
-                        return false;
-                    }
+                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
-                    if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, (cardSource) => CanSelectTrashCardCondition(cardSource)))
-                    {
-                        bool noSelect = CanNoSelect(CardEffectCommons.GetCardFromHashtable(_hashtable));
-                        List<CardSource> selectedCards = new List<CardSource>();
+                        if (GManager.instance.userSelectionManager.SelectedIntValue == 3)
+                        {
+                            break;
+                        }
+                        if (GManager.instance.userSelectionManager.SelectedIntValue == 1)
+                        {
+                            bool canNoSelect = noSelect() && validTrashCardCount > 0;
+                            int maxCount = Math.Min(3 - digivolutionCards.Count, validPermanentCount);
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectPermanentCondition,
+                                canTargetCondition_ByPreSelecetedList: ValidPermanentCombination,
+                                canEndSelectCondition: CanEndSelectCondition,
+                                maxCount: maxCount,
+                                canNoSelect: canNoSelect, //if need to select cards and no valid trash cards
+                                canEndNotMax: true,
+                                selectPermanentCoroutine: SelectPermanentCoroutine,
+                                afterSelectPermanentCoroutine: null,
+                                mode: SelectPermanentEffect.Mode.Custom,
+                                cardEffect: activateClass);
 
-                        int maxCount = Math.Min(3 - digivolutionCards.Count, card.Owner.TrashCards.Count((cardSource) => CanSelectTrashCardCondition(cardSource)));
+                            selectPermanentEffect.SetUpCustomMessage("Select Digimon to place.", "The opponent is selecting Digimon to place.");
 
-                        if (maxCount >= 1)
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                            bool CanEndSelectCondition(List<Permanent> permanents)
+                            {
+                                List<CardSource> chosenCards = permanents.Map(perm => perm.TopCard);
+
+                                return ValidCardCombination(chosenCards);
+                            }
+
+                            IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                            {
+                                digivolutionCards.Add(permanent.TopCard);
+
+                                yield return null;
+                            }
+                            validPermanentCount = CardEffectCommons.MatchConditionOwnersPermanentCount(card, CanSelectPermanentCondition);
+                        }
+                        else
                         {
+                            bool canNoSelect = noSelect() && validPermanentCount > 0;
+                            int maxCount = Math.Min(3 - digivolutionCards.Count, validTrashCardCount);
                             SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                             selectCardEffect.SetUp(
-                                canTargetCondition: CanSelectTrashCardCondition,
-                                canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
-                                canEndSelectCondition: CanEndSelectCondition,
-                                canNoSelect: () => noSelect,
+                                canTargetCondition: CanSelectCardCondition,
+                                canTargetCondition_ByPreSelecetedList: ValidCardSourceCombination,
+                                canEndSelectCondition: ValidCardCombination,
+                                canNoSelect: () => canNoSelect,
                                 selectCardCoroutine: SelectCardCoroutine,
                                 afterSelectCardCoroutine: null,
                                 message: "Select cards to place in Digivolution cards.",
@@ -153,87 +208,27 @@ namespace DCGO.CardEffects.BT15
 
                             yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
 
-                            bool CanTargetCondition_ByPreSelecetedList(List<CardSource> cardSources, CardSource cardSource)
-                            {
-                                List<string> cardIDs = new List<string>();
-
-                                foreach (CardSource cardSource1 in cardSources)
-                                {
-                                    if (!cardIDs.Contains(cardSource1.CardID))
-                                    {
-                                        cardIDs.Add(cardSource1.CardID);
-                                    }
-                                }
-
-                                foreach (CardSource cardSource1 in digivolutionCards)
-                                {
-                                    if (!cardIDs.Contains(cardSource1.CardID))
-                                    {
-                                        cardIDs.Add(cardSource1.CardID);
-                                    }
-                                }
-
-                                if (cardIDs.Contains(cardSource.CardID))
-                                {
-                                    return false;
-                                }
-
-                                return true;
-                            }
-
-                            bool CanEndSelectCondition(List<CardSource> cardSources)
-                            {
-                                List<string> cardIDs = new List<string>();
-
-                                foreach (CardSource cardSource1 in cardSources)
-                                {
-                                    if (!cardIDs.Contains(cardSource1.CardID))
-                                    {
-                                        cardIDs.Add(cardSource1.CardID);
-                                    }
-                                }
-
-                                foreach (CardSource cardSource1 in digivolutionCards)
-                                {
-                                    if (!cardIDs.Contains(cardSource1.CardID))
-                                    {
-                                        cardIDs.Add(cardSource1.CardID);
-                                    }
-                                }
-
-                                if (cardIDs.Count != cardSources.Count + digivolutionCards.Count)
-                                {
-                                    return false;
-                                }
-
-                                return true;
-                            }
-
                             IEnumerator SelectCardCoroutine(CardSource cardSource)
                             {
-                                selectedCards.Add(cardSource);
                                 digivolutionCards.Add(cardSource);
-                                yield return null;
-                            }
-
-                            if (selectedCards.Count >= 1)
-                            {
-                                GManager.instance.GetComponent<SelectDigiXrosClass>().AddDigivolutionCardInfos(new AddDigivolutionCardsInfo(activateClass, selectedCards));
 
-                                yield return StartCoroutine(AfterSelectCardCoroutine(selectedCards));
+                                yield return null;
                             }
+                            validTrashCardCount = card.Owner.TrashCards.Count(CanSelectCardCondition);
                         }
                     }
 
-                    IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
+                    if (digivolutionCards.Count >= 1)
                     {
+                        GManager.instance.GetComponent<SelectDigiXrosClass>().AddDigivolutionCardInfos(new AddDigivolutionCardsInfo(activateClass, digivolutionCards));
+
                         if (card.Owner.CanReduceCost(null, card))
                         {
                             ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
                         }
 
                         ChangeCostClass changeCostClass = new ChangeCostClass();
-                        changeCostClass.SetUpICardEffect("Play Cost -4", CanUseCondition1, card);
+                        changeCostClass.SetUpICardEffect($"Play Cost {-4 * digivolutionCards.Count}", CanUseCondition1, card);
                         changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
                         card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
 
@@ -244,15 +239,11 @@ namespace DCGO.CardEffects.BT15
 
                         int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
                         {
-                            if (CardSourceCondition(cardSource))
+                            if (CardSourceCondition(cardSource)
+                            && RootCondition(root)
+                            && PermanentsCondition(targetPermanents))
                             {
-                                if (RootCondition(root))
-                                {
-                                    if (PermanentsCondition(targetPermanents))
-                                    {
-                                        Cost -= cardSources.Count * 4;
-                                    }
-                                }
+                                Cost -= digivolutionCards.Count * 4;
                             }
 
                             return Cost;
@@ -260,19 +251,8 @@ namespace DCGO.CardEffects.BT15
 
                         bool PermanentsCondition(List<Permanent> targetPermanents)
                         {
-                            if (targetPermanents == null)
-                            {
-                                return true;
-                            }
-                            else
-                            {
-                                if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
-                                {
-                                    return true;
-                                }
-                            }
-
-                            return false;
+                            return targetPermanents == null
+                                    || targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0;
                         }
 
                         bool CardSourceCondition(CardSource cardSource)
@@ -291,16 +271,12 @@ namespace DCGO.CardEffects.BT15
                         }
 
                         yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
-
-                        yield return null;
                     }
                 }
             }
-
             #endregion
 
             #region Reduce Play Cost - Not Shown
-
             if (timing == EffectTiming.None)
             {
                 ChangeCostClass changeCostClass = new ChangeCostClass();
@@ -311,49 +287,34 @@ namespace DCGO.CardEffects.BT15
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (cardSource.IsDigimon)
-                    {
-                        if (cardSource.CardTraits.Contains("Dark Masters") || cardSource.CardTraits.Contains("DarkMasters"))
-                        {
-                            return true;
-                        }
-                    }
+                    return cardSource.EqualsTraits("Dark Masters");
+                }
 
-                    return false;
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    return CanSelectCardCondition(permanent.TopCard);
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (card.Owner.HandCards.Contains(card))
-                    {
-                        ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Placing 1 [Dark Masters] to get Play Cost -4");
+                    ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Placing 1 [Dark Masters] to get Play Cost -4");
 
-                        if (activateClass != null)
-                        {
-                            if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
-                            {
-                                return true;
-                            }
-                        }
-                    }
-
-                    return false;
+                    return activateClass != null
+                        && (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition)
+                            || CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition));
                 }
 
                 int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
                 {
-                    if (CardSourceCondition(cardSource))
+                    if (CardSourceCondition(cardSource)
+                    && RootCondition(root)
+                    && PermanentsCondition(targetPermanents))
                     {
-                        if (RootCondition(root))
-                        {
-                            if (PermanentsCondition(targetPermanents))
-                            {
-                                List<CardSource> trashSources = card.Owner.TrashCards.Filter(CanSelectCardCondition);
-                                int targetCount = (from trashCard in trashSources select trashCard.CardID).Distinct().Count();
+                        List<CardSource> validCards = card.Owner.GetBattleAreaDigimons().Filter(CanSelectPermanentCondition).Map(permanent => permanent.TopCard);
+                        validCards.AddRange(card.Owner.TrashCards.Filter(CanSelectCardCondition));
+                        int targetCount = Math.Min(3, Combinations.GetUniqueNameCardCount(validCards));
 
-                                Cost -= targetCount * 4;
-                            }
-                        }
+                        Cost -= targetCount * 4;
                     }
 
                     return Cost;
@@ -361,32 +322,14 @@ namespace DCGO.CardEffects.BT15
 
                 bool PermanentsCondition(List<Permanent> targetPermanents)
                 {
-                    if (targetPermanents == null)
-                    {
-                        return true;
-                    }
-                    else
-                    {
-                        if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return targetPermanents == null
+                            || targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0;
                 }
 
                 bool CardSourceCondition(CardSource cardSource)
                 {
-                    if (cardSource != null)
-                    {
-                        if (cardSource == card)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return cardSource != null
+                        && cardSource == card;
                 }
 
                 bool RootCondition(SelectCardEffect.Root root)
@@ -399,191 +342,155 @@ namespace DCGO.CardEffects.BT15
                     return true;
                 }
             }
-
             #endregion
 
             #region End of Your Turn
-
             if (timing == EffectTiming.OnEndTurn)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Place 1 digimon from trash under this Digimon's digivolution cards", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetUpICardEffect("Place 1 digimon from trash under this Digimon's digivolution cards and activate one of it's [On Play] effects", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
+                activateClass.SetIsDigimonEffect(true);
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
                     return "[End of Your Turn] [Once Per Turn] By placing 1 level 6 or lower card from your trash as this Digimon's bottom digivolution card, activate 1 [On Play] effect on that card as an effect. Then, trash the top 2 cards of your opponent's deck for each of this Digimon's level 6 digivolution cards.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (cardSource.IsDigimon)
-                    {
-                        if (cardSource.HasLevel)
-                        {
-                            if (cardSource.Level <= 6)
-                            {
-                                return true;
-                            }
-                        }
-                    }
-
-                    return false;
+                    return cardSource.HasLevel
+                        && cardSource.Level <= 6;
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (CardEffectCommons.IsOwnerTurn(card))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
+                        && CardEffectCommons.IsOwnerTurn(card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass)
+                        && CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
-                        {
-                            int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
-
-                            List<CardSource> selectedCards = new List<CardSource>();
-
-                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                            {
-                                selectedCards.Add(cardSource);
+                    List<CardSource> selectedCards = new List<CardSource>();
 
-                                yield return null;
-                            }
+                    IEnumerator SelectCardCoroutine(CardSource cardSource)
+                    {
+                        selectedCards.Add(cardSource);
 
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+                        yield return null;
+                    }
 
-                            selectCardEffect.SetUp(
-                                canTargetCondition: CanSelectCardCondition,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: SelectCardCoroutine,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 card to place on bottom of digivolution cards.",
-                                maxCount: maxCount,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.Custom,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                    selectCardEffect.SetUp(
+                        canTargetCondition: CanSelectCardCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: () => true,
+                        selectCardCoroutine: SelectCardCoroutine,
+                        afterSelectCardCoroutine: null,
+                        message: "Select 1 card to place on bottom of digivolution cards.",
+                        maxCount: 1,
+                        canEndNotMax: false,
+                        isShowOpponent: true,
+                        mode: SelectCardEffect.Mode.Custom,
+                        root: SelectCardEffect.Root.Trash,
+                        customRootCardList: null,
+                        canLookReverseCard: true,
+                        selectPlayer: card.Owner,
+                        cardEffect: activateClass);
+
+                    selectCardEffect.SetUpCustomMessage(
+                        "Select 1 card to place on bottom of digivolution cards.",
+                        "The opponent is selecting 1 card to place on bottom of digivolution cards.");
+                    selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+
+                    CardSource selectedCard = null;
+
+                    if (selectedCards.Count >= 1)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
+                            selectedCards,
+                            activateClass));
 
-                            selectCardEffect.SetUpCustomMessage(
-                                "Select 1 card to place on bottom of digivolution cards.",
-                                "The opponent is selecting 1 card to place on bottom of digivolution cards.");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+                        selectedCard = selectedCards[0];
+                    }
 
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                    if (selectedCard != null)
+                    {
+                        List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
+                            .Clone()
+                            .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
 
-                            CardSource selectedCard = null;
+                        if (candidateEffects.Count >= 1)
+                        {
+                            ICardEffect selectedEffect = null;
 
-                            if (selectedCards.Count >= 1)
+                            if (candidateEffects.Count == 1)
                             {
-                                if (CardEffectCommons.IsExistOnBattleArea(card))
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
-                                        selectedCards,
-                                        activateClass));
-
-                                    selectedCard = selectedCards[0];
-                                }
+                                selectedEffect = candidateEffects[0];
                             }
-
-                            if (selectedCard != null)
+                            else
                             {
-                                List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
-                                    .Clone()
-                                    .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
-
-                                if (candidateEffects.Count >= 1)
+                                List<SkillInfo> skillInfos = candidateEffects
+                                    .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
+
+                                List<CardSource> cardSources = candidateEffects
+                                    .Map(cardEffect => cardEffect.EffectSourceCard);
+
+                                SelectCardEffect selectSourceCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                selectSourceCardEffect.SetUp(
+                                    canTargetCondition: (cardSource) => true,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => false,
+                                    selectCardCoroutine: null,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select 1 effect to activate.",
+                                    maxCount: 1,
+                                    canEndNotMax: false,
+                                    isShowOpponent: false,
+                                    mode: SelectCardEffect.Mode.Custom,
+                                    root: SelectCardEffect.Root.Custom,
+                                    customRootCardList: cardSources,
+                                    canLookReverseCard: true,
+                                    selectPlayer: card.Owner,
+                                    cardEffect: activateClass);
+
+                                selectSourceCardEffect.SetNotShowCard();
+                                selectSourceCardEffect.SetUpSkillInfos(skillInfos);
+                                selectSourceCardEffect.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
+
+                                yield return ContinuousController.instance.StartCoroutine(selectSourceCardEffect.Activate());
+
+                                IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
                                 {
-                                    ICardEffect selectedEffect = null;
-
-                                    if (candidateEffects.Count == 1)
-                                    {
-                                        selectedEffect = candidateEffects[0];
-                                    }
-                                    else
+                                    if (selectedIndexes.Count == 1)
                                     {
-                                        List<SkillInfo> skillInfos = candidateEffects
-                                            .Map(cardEffect => new SkillInfo(cardEffect, null, EffectTiming.None));
-
-                                        List<CardSource> cardSources = candidateEffects
-                                            .Map(cardEffect => cardEffect.EffectSourceCard);
-
-                                        SelectCardEffect selectSourceCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                        selectSourceCardEffect.SetUp(
-                                            canTargetCondition: (cardSource) => true,
-                                            canTargetCondition_ByPreSelecetedList: null,
-                                            canEndSelectCondition: null,
-                                            canNoSelect: () => false,
-                                            selectCardCoroutine: null,
-                                            afterSelectCardCoroutine: null,
-                                            message: "Select 1 effect to activate.",
-                                            maxCount: 1,
-                                            canEndNotMax: false,
-                                            isShowOpponent: false,
-                                            mode: SelectCardEffect.Mode.Custom,
-                                            root: SelectCardEffect.Root.Custom,
-                                            customRootCardList: cardSources,
-                                            canLookReverseCard: true,
-                                            selectPlayer: card.Owner,
-                                            cardEffect: activateClass);
-
-                                        selectSourceCardEffect.SetNotShowCard();
-                                        selectSourceCardEffect.SetUpSkillInfos(skillInfos);
-                                        selectSourceCardEffect.SetUpAfterSelectIndexCoroutine(AfterSelectIndexCoroutine);
-
-                                        yield return ContinuousController.instance.StartCoroutine(selectSourceCardEffect.Activate());
-
-                                        IEnumerator AfterSelectIndexCoroutine(List<int> selectedIndexes)
-                                        {
-                                            if (selectedIndexes.Count == 1)
-                                            {
-                                                selectedEffect = candidateEffects[selectedIndexes[0]];
-                                                yield return null;
-                                            }
-                                        }
+                                        selectedEffect = candidateEffects[selectedIndexes[0]];
+                                        yield return null;
                                     }
+                                }
+                            }
 
-                                    if (selectedEffect != null)
-                                    {
-                                        Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
+                            if (selectedEffect != null)
+                            {
+                                Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
 
-                                        if (selectedEffect.CanUse(effectHashtable))
-                                        {
-                                            yield return ContinuousController.instance.StartCoroutine(
-                                                ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
-                                        }
-                                    }
+                                if (selectedEffect.CanUse(effectHashtable))
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine(
+                                        ((ActivateICardEffect)selectedEffect).Activate_Optional_Effect_Execute(effectHashtable));
                                 }
                             }
                         }
@@ -594,7 +501,6 @@ namespace DCGO.CardEffects.BT15
                     yield return ContinuousController.instance.StartCoroutine(new IAddTrashCardsFromLibraryTop(trashCount, card.Owner.Enemy, activateClass).AddTrashCardsFromLibraryTop());
                 }
             }
-
             #endregion
 
             return cardEffects;

+ 2 - 1
Assets/Scripts/CardEffect/BT16/Red/BT16_015.cs

@@ -37,6 +37,7 @@ namespace DCGO.CardEffects.BT16
                 activateClass.SetUpICardEffect("Add [End of Attack] to all of this Digimon's [On Deletion] effects.", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 activateClass.SetIsBackgroundProcess(true);
+                activateClass.SetIsDigimonEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -242,4 +243,4 @@ namespace DCGO.CardEffects.BT16
             return cardEffects;
         }
     }
-}
+}

+ 25 - 0
Assets/Scripts/CardEffect/BT19/Black/BT19_063.cs

@@ -272,6 +272,31 @@ namespace DCGO.CardEffects.BT19
                             yield return ContinuousController.instance.StartCoroutine(new IDegeneration(permanent, 1, activateClass).Degeneration());
                         }
                     }
+
+                    if (CardEffectCommons.IsDijiXros(_hashtable, card, (count) => count == 2))
+                    {
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
+                        {
+                            int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition1));
+
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectPermanentCondition1,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount,
+                                canNoSelect: true,
+                                canEndNotMax: false,
+                                selectPermanentCoroutine: null,
+                                afterSelectPermanentCoroutine: null,
+                                mode: SelectPermanentEffect.Mode.Destroy,
+                                cardEffect: activateClass);
+
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                        }
+                    }
                 }
             }
             #endregion

+ 19 - 37
Assets/Scripts/CardEffect/BT20/Red/BT20_093.cs

@@ -1,10 +1,9 @@
 using System.Collections;
 using System.Collections.Generic;
-using UnityEngine;
 using System.Linq;
 using System;
-using Photon.Pun;
 
+// Unleash the Dragon-Gene
 namespace DCGO.CardEffects.BT20
 {
     public class BT20_093 : CEntity_Effect
@@ -14,7 +13,6 @@ namespace DCGO.CardEffects.BT20
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region Main Effect
-
             if (timing == EffectTiming.OptionSkill)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -45,7 +43,6 @@ namespace DCGO.CardEffects.BT20
                     if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
                     {
                         #region Reduce Play Cost
-
                         ChangeCostClass changeCostClass = new ChangeCostClass();
                         changeCostClass.SetUpICardEffect($"Play Cost -3", CanUseReduceCondition, card);
                         changeCostClass.SetUpChangeCostClass(
@@ -75,33 +72,20 @@ namespace DCGO.CardEffects.BT20
 
                         int ChangeCost(CardSource cardSource, int cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
                         {
-                            if (CardSourceCondition(cardSource))
+                            if (CardSourceCondition(cardSource)
+                            && RootCondition(root)
+                            && PermanentsCondition(targetPermanents))
                             {
-                                if (RootCondition(root))
-                                {
-                                    if (PermanentsCondition(targetPermanents))
-                                    {
-                                        cost -= 3;
-                                    }
-                                }
+                                cost -= 3;
                             }
-
+                             
                             return cost;
                         }
 
                         bool PermanentsCondition(List<Permanent> targetPermanents)
                         {
-                            if (targetPermanents == null)
-                            {
-                                return true;
-                            }
-
-                            if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
-                            {
-                                return true;
-                            }
-
-                            return false;
+                            return targetPermanents == null
+                                    || targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0;
                         }
 
                         bool CardSourceCondition(CardSource cardSource)
@@ -118,7 +102,6 @@ namespace DCGO.CardEffects.BT20
                         {
                             return true;
                         }
-
                         #endregion
 
                         List<CardSource> selectedCards = new List<CardSource>();
@@ -158,17 +141,19 @@ namespace DCGO.CardEffects.BT20
                             isTapped: false,
                             root: SelectCardEffect.Root.Hand,
                             activateETB: true));
+
+                        #region Remove Reduction
+                        card.Owner.UntilCalculateFixedCostEffect.Remove(getCardEffect);
+                        #endregion
                     }
 
                     yield return ContinuousController.instance.StartCoroutine(
                         CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
                 }
             }
-
             #endregion
 
             #region Delay Effect
-
             if (timing == EffectTiming.WhenRemoveField)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -215,19 +200,17 @@ namespace DCGO.CardEffects.BT20
                 IEnumerator SuccessProcess()
                 {
                     yield return ContinuousController.instance.StartCoroutine(
-                                                        CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
-                                                            CanSelectDNACardCondition,
-                                                            payCost: true,
-                                                            isHand: true,
-                                                            activateClass
-                                                        ));
+                        CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
+                            CanSelectDNACardCondition,
+                            payCost: true,
+                            isHand: true,
+                            activateClass
+                        ));
                 }
             }
-
             #endregion
 
             #region Security Effect
-
             if (timing == EffectTiming.SecuritySkill)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -356,10 +339,9 @@ namespace DCGO.CardEffects.BT20
                         CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
                 }
             }
-
             #endregion
 
             return cardEffects;
         }
     }
-}
+}

+ 131 - 411
Assets/Scripts/CardEffect/BT21/Yellow/BT21_044.cs

@@ -1,8 +1,7 @@
-using System;
 using System.Collections;
 using System.Collections.Generic;
-using System.Linq;
 
+// RizeGreymon
 namespace DCGO.CardEffects.BT21
 {
     public class BT21_044 : CEntity_Effect
@@ -23,251 +22,168 @@ namespace DCGO.CardEffects.BT21
             }
             #endregion
 
-            #region On Play
-            if (timing == EffectTiming.OnEnterFieldAnyone)
-            {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("[Marcus Damon] becomes a Digimon", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
-                cardEffects.Add(activateClass);
-
-                string EffectDiscription()
-                {
-                    return "[On Play] For the turn, 1 of your [Marcus Damon]s is also treated as a 3000 DP Digimon, can't digivolve, and gains <Rush> and <Alliance>. Then, 1 of your Digimon may attack.";
-                }
+            #region Shared OP/WD
+            string SharedEffectName = "[Marcus Damon] becomes a Digimon with <Rush> and <Alliance> for turn, then 1 Digimon may attack";
 
-                bool CanSelectPermanentCondition(Permanent permanent)
-                {
-                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
-                    {
-                        if (permanent.TopCard.EqualsCardName("Marcus Damon"))
-                        {
-                            return true;
-                        }
-                    }
+            CardEffectFactory.ActivateClassesForSharedEffects
+                (ref cardEffects, timing, card,
+                    SharedEffectName,
+                    SharedActivateCoroutine,
+                    SharedEffectDescription,
+                    optional: false,
+                    isSkippableFunction: IsSkippable,
+                    onPlay: true,
+                    whenDigivolving: true);
 
-                    return false;
-                }
+            string SharedEffectDescription(string tag) => $"[{tag}] For the turn, 1 of your [Marcus Damon]s is also treated as a 3000 DP Digimon, can't digivolve, and gains <Rush> and <Alliance>. Then, 1 of your Digimon may attack.";
 
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
-                }
+            bool IsSkippable(Hashtable hashtable)
+            {
+                return !CardEffectCommons.HasMatchConditionPermanent(SharedCanSelectPermanentCondition);
+            }
 
-                bool CanSelectOwnerPermanentCondition(Permanent permanent)
-                {
-                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
-                }
+            bool SharedCanSelectPermanentCondition(Permanent permanent)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
+                    && permanent.TopCard.EqualsCardName("Marcus Damon");
+            }
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
-                }
+            bool SharedCanSelectOwnerPermanentCondition(Permanent permanent, ActivateClass activateClass)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
+                    && permanent.CanAttack(activateClass);
+            }
 
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+            IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
+            {
+                if (CardEffectCommons.HasMatchConditionPermanent(SharedCanSelectPermanentCondition))
                 {
-                    if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
-                    {
-                        int maxCount = Math.Min(1, card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition));
-
-                        SelectPermanentEffect selectPermanentEffect1 = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffect1.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: maxCount,
-                            canNoSelect: false,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: SelectPermanentCoroutine1,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Custom,
-                            cardEffect: activateClass);
-
-                        selectPermanentEffect1.SetUpCustomMessage("Select 1 [Marcus Damon].", "The opponent is selecting 1 [Marcus Damon].");
+                    SelectPermanentEffect selectPermanentEffect1 = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect1.Activate());
+                    selectPermanentEffect1.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: SharedCanSelectPermanentCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: SelectPermanentCoroutine1,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Custom,
+                        cardEffect: activateClass);
 
-                        IEnumerator SelectPermanentCoroutine1(Permanent selectedPermanent)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BecomeDigimonThatCantDigivolve(targetPermanent: selectedPermanent, DP: 3000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
+                    selectPermanentEffect1.SetUpCustomMessage("Select 1 [Marcus Damon].", "The opponent is selecting 1 [Marcus Damon].");
 
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect1.Activate());
 
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainAlliance(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
-                        }
-                    }
-
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOwnerPermanentCondition))
+                    IEnumerator SelectPermanentCoroutine1(Permanent selectedPermanent)
                     {
-                        Permanent selectedPermanent = null;
-
-                        SelectPermanentEffect selectPermanentEffect2 = GManager.instance.GetComponent<SelectPermanentEffect>();
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BecomeDigimonThatCantDigivolve(targetPermanent: selectedPermanent, DP: 3000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
 
-                        selectPermanentEffect2.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectOwnerPermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: 1,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: SelectPermanentCoroutine2,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Custom,
-                            cardEffect: activateClass);
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
 
-                        selectPermanentEffect2.SetUpCustomMessage("Select 1 Digimon that will attack.",
-                            "The opponent is selecting 1 Digimon that will attack.");
-
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect2.Activate());
-
-                        IEnumerator SelectPermanentCoroutine2(Permanent permanent)
-                        {
-                            selectedPermanent = permanent;
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainAlliance(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
+                    }
+                }
 
-                            yield return null;
-                        }
+                if (CardEffectCommons.HasMatchConditionPermanent(_ => SharedCanSelectOwnerPermanentCondition(_, activateClass)))
+                {
+                    SelectPermanentEffect selectPermanentEffect2 = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                        if (selectedPermanent != null && selectedPermanent.CanAttack(activateClass))
-                        {
-                            SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
+                    selectPermanentEffect2.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: _ => SharedCanSelectOwnerPermanentCondition(_, activateClass),
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: true,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Attack,
+                        cardEffect: activateClass);
 
-                            selectAttackEffect.SetUp(
-                                attacker: selectedPermanent,
-                                canAttackPlayerCondition: () => true,
-                                defenderCondition: _ => true,
-                                cardEffect: activateClass);
+                    selectPermanentEffect2.SetUpCustomMessage("Select 1 Digimon that will attack.",
+                        "The opponent is selecting 1 Digimon that will attack.");
 
-                            yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
-                        }
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect2.Activate());
                 }
             }
             #endregion
 
-            #region When Digivolving
-            if (timing == EffectTiming.OnEnterFieldAnyone)
+            #region Shared AT/Inherit
+            string SharedEffectDescription1()
             {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("[Marcus Damon] becomes a Digimon", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
-                cardEffects.Add(activateClass);
-
-                string EffectDiscription()
-                {
-                    return "[When Digivolving] For the turn, 1 of your [Marcus Damon]s is also treated as a 3000 DP Digimon, can't digivolve, and gains <Rush> and <Alliance>. Then, 1 of your Digimon may attack.";
-                }
-
-                bool CanSelectPermanentCondition(Permanent permanent)
-                {
-                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
-                    {
-                        if (permanent.TopCard.EqualsCardName("Marcus Damon"))
-                        {
-                            return true;
-                        }
-                    }
+                return "[All Turns][Once Per Turn] When any of your yellow or red Tamers are deleted, you may place 1 [Marcus Damon] from your trash as the top security card.";
+            }
 
-                    return false;
-                }
+            bool SharedCanActivateCondition1(ActivateClass activateClass)
+            {
+                return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass);
+            }
 
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
-                }
+            bool SharedCanSelectCardCondition1(CardSource cardSource)
+            {
+                return cardSource.EqualsCardName("Marcus Damon");
+            }
 
-                bool CanSelectOwnerPermanentCondition(Permanent permanent)
-                {
-                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
-                }
+            bool SharedPermanentCondition1(Permanent permanent)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaTamer(permanent, card);
+            }
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
-                }
+            IEnumerator SharedActivateCoroutine1(ActivateClass activateClass)
+            {
+                bool Used = false;
 
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                if (card.Owner.CanAddSecurity(activateClass)
+                && CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, SharedCanSelectCardCondition1))
                 {
-                    if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
-                    {
-                        int maxCount = Math.Min(1, card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition));
-
-                        SelectPermanentEffect selectPermanentEffect1 = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffect1.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectPermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: maxCount,
-                            canNoSelect: false,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: SelectPermanentCoroutine1,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Custom,
-                            cardEffect: activateClass);
+                    List<CardSource> selectedCards = new List<CardSource>();
 
-                        selectPermanentEffect1.SetUpCustomMessage("Select 1 [Marcus Damon].", "The opponent is selecting 1 [Marcus Damon].");
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect1.Activate());
+                    selectCardEffect.SetUp(
+                        canTargetCondition: SharedCanSelectCardCondition1,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: () => true,
+                        selectCardCoroutine: SelectCardCoroutine,
+                        afterSelectCardCoroutine: null,
+                        message: "Select 1 [Marcus Damon] to add to security.",
+                        maxCount: 1,
+                        canEndNotMax: false,
+                        isShowOpponent: true,
+                        mode: SelectCardEffect.Mode.Custom,
+                        root: SelectCardEffect.Root.Trash,
+                        customRootCardList: null,
+                        canLookReverseCard: true,
+                        selectPlayer: card.Owner,
+                        cardEffect: activateClass);
 
-                        IEnumerator SelectPermanentCoroutine1(Permanent selectedPermanent)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BecomeDigimonThatCantDigivolve(targetPermanent: selectedPermanent, DP: 3000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
-
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
+                    selectCardEffect.SetUpCustomMessage("Select 1 card to add to security.", "The opponent is selecting 1 card to add to security.");
+                    selectCardEffect.SetUpCustomMessage_ShowCard("Security Card");
 
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainAlliance(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
-                        }
-                    }                        
+                    yield return StartCoroutine(selectCardEffect.Activate());
 
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOwnerPermanentCondition))
+                    IEnumerator SelectCardCoroutine(CardSource cardSource)
                     {
-                        Permanent selectedPermanent = null;
-
-                        SelectPermanentEffect selectPermanentEffect2 = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffect2.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: CanSelectOwnerPermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: 1,
-                            canNoSelect: true,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: SelectPermanentCoroutine2,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Custom,
-                            cardEffect: activateClass);
+                        selectedCards.Add(cardSource);
 
-                        selectPermanentEffect2.SetUpCustomMessage("Select 1 Digimon that will attack.",
-                            "The opponent is selecting 1 Digimon that will attack.");
-
-                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect2.Activate());
-
-                        IEnumerator SelectPermanentCoroutine2(Permanent permanent)
-                        {
-                            selectedPermanent = permanent;
-
-                            yield return null;
-                        }
+                        yield return null;
+                    }
 
-                        if (selectedPermanent != null && selectedPermanent.CanAttack(activateClass))
+                    if (selectedCards.Count >= 1)
+                    {
+                        foreach (CardSource selectedCard in selectedCards)
                         {
-                            SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
-
-                            selectAttackEffect.SetUp(
-                                attacker: selectedPermanent,
-                                canAttackPlayerCondition: () => true,
-                                defenderCondition: _ => true,
-                                cardEffect: activateClass);
-
-                            yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
+                            yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(selectedCard));
                         }
                     }
                 }
+
+                if (!Used) activateClass.RemoveUse();
             }
             #endregion
 
@@ -276,112 +192,14 @@ namespace DCGO.CardEffects.BT21
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Place 1 [Marcus Damon] on the top of security from trash", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
-                activateClass.SetHashString("AddSecurity_BT21_044");
+                activateClass.SetUpActivateClass(_ => SharedCanActivateCondition1(activateClass), _ => SharedActivateCoroutine1(activateClass), 1, false, SharedEffectDescription1());
+                activateClass.SetHashString("BT21_044_AT");
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
-                {
-                    return "[All Turns][Once Per Turn] When any of your yellow or red Tamers are deleted, you may place 1 [Marcus Damon] from your trash as the top security card.";
-                }
-
-                bool CanSelectCardCondition(CardSource cardSource)
-                {
-                    if (cardSource.EqualsCardName("Marcus Damon"))
-                    {
-                        return true;
-                    }
-
-                    return false;
-                }
-
-                bool PermanentCondition(Permanent permanent)
-                {
-                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
-                    {
-                        if (permanent.IsTamer)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        return true;
-                    }
-
-                    return false;
-                }
-
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
-                {
-                    if (card.Owner.CanAddSecurity(activateClass))
-                    {
-                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
-                        {
-                            int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
-
-                            List<CardSource> selectedCards = new List<CardSource>();
-
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                        canTargetCondition: CanSelectCardCondition,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        canNoSelect: () => false,
-                                        selectCardCoroutine: SelectCardCoroutine,
-                                        afterSelectCardCoroutine: null,
-                                        message: "Select 1 [Marcus Damon] to add to security.",
-                                        maxCount: maxCount,
-                                        canEndNotMax: false,
-                                        isShowOpponent: true,
-                                        mode: SelectCardEffect.Mode.Custom,
-                                        root: SelectCardEffect.Root.Trash,
-                                        customRootCardList: null,
-                                        canLookReverseCard: true,
-                                        selectPlayer: card.Owner,
-                                        cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 card to add to security.", "The opponent is selecting 1 card to add to security.");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Security Card");
-
-                            yield return StartCoroutine(selectCardEffect.Activate());
-
-                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                            {
-                                selectedCards.Add(cardSource);
-
-                                yield return null;
-                            }
-
-                            if (selectedCards.Count >= 1)
-                            {
-                                foreach (CardSource selectedCard in selectedCards)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(selectedCard));
-                                }
-                            }
-                        }
-                    }
+                    return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
+                        && CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, SharedPermanentCondition1);
                 }
             }
             #endregion
@@ -391,113 +209,15 @@ namespace DCGO.CardEffects.BT21
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Place 1 [Marcus Damon] on the top of security from trash", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(_ => SharedCanActivateCondition1(activateClass), _ => SharedActivateCoroutine1(activateClass), 1, false, SharedEffectDescription1());
                 activateClass.SetIsInheritedEffect(true);
-                activateClass.SetHashString("ESSAddSecurity_BT21_044");
+                activateClass.SetHashString("BT21_044_Inherited_AT");
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
-                {
-                    return "[All Turns][Once Per Turn] When any of your yellow or red Tamers are deleted, you may place 1 [Marcus Damon] from your trash as the top security card.";
-                }
-
-                bool CanSelectCardCondition(CardSource cardSource)
-                {
-                    if (cardSource.EqualsCardName("Marcus Damon"))
-                    {
-                        return true;
-                    }
-
-                    return false;
-                }
-
-                bool PermanentCondition(Permanent permanent)
-                {
-                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
-                    {
-                        if (permanent.IsTamer)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        return true;
-                    }
-
-                    return false;
-                }
-
-                IEnumerator ActivateCoroutine(Hashtable _hashtable)
-                {
-                    if (card.Owner.CanAddSecurity(activateClass))
-                    {
-                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
-                        {
-                            int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
-
-                            List<CardSource> selectedCards = new List<CardSource>();
-
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                        canTargetCondition: CanSelectCardCondition,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        canNoSelect: () => false,
-                                        selectCardCoroutine: SelectCardCoroutine,
-                                        afterSelectCardCoroutine: null,
-                                        message: "Select 1 [Marcus Damon] to add to security.",
-                                        maxCount: maxCount,
-                                        canEndNotMax: false,
-                                        isShowOpponent: true,
-                                        mode: SelectCardEffect.Mode.Custom,
-                                        root: SelectCardEffect.Root.Trash,
-                                        customRootCardList: null,
-                                        canLookReverseCard: true,
-                                        selectPlayer: card.Owner,
-                                        cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 card to add to security.", "The opponent is selecting 1 card to add to security.");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Security Card");
-
-                            yield return StartCoroutine(selectCardEffect.Activate());
-
-                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                            {
-                                selectedCards.Add(cardSource);
-
-                                yield return null;
-                            }
-
-                            if (selectedCards.Count >= 1)
-                            {
-                                foreach (CardSource selectedCard in selectedCards)
-                                {
-                                    yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddSecurityCard(selectedCard));
-                                }
-                            }
-                        }
-                    }
+                    return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
+                        && CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, SharedPermanentCondition1);
                 }
             }
             #endregion
@@ -505,4 +225,4 @@ namespace DCGO.CardEffects.BT21
             return cardEffects;
         }
     }
-}
+}

+ 2 - 2
Assets/Scripts/CardEffect/BT22/Yellow/BT22_042.cs

@@ -1,7 +1,6 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
-using System.Linq;
 
 // Nyabootmon
 namespace DCGO.CardEffects.BT22
@@ -181,6 +180,7 @@ namespace DCGO.CardEffects.BT22
                 activateClass.SetUpICardEffect("Activate a [When Digivolving] effect", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
                 activateClass.SetHashString("BT22_042_UseWD");
+                activateClass.SetIsDigimonEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -282,4 +282,4 @@ namespace DCGO.CardEffects.BT22
             return cardEffects;
         }
     }
-}
+}

+ 5 - 3
Assets/Scripts/CardEffect/BT25/Purple/BT25_080.cs

@@ -100,7 +100,9 @@ namespace DCGO.CardEffects.BT25
                             yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
                         }
 
-                        if (CardEffectCommons.IsByEffect(hashtable, null) && CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermanentCondition))
+                        if (CardEffectCommons.IsByEffect(hashtable, null)
+                        && CardEffectCommons.CanTriggerOnPlay(hashtable, card)
+                        && CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                         {
                             SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
@@ -122,7 +124,7 @@ namespace DCGO.CardEffects.BT25
                     }
                     else activateClass.RemoveUse();
                 }
-                
+
             }
             #endregion
 
@@ -188,4 +190,4 @@ namespace DCGO.CardEffects.BT25
             return cardEffects;
         }
     }
-}
+}

+ 0 - 5
Assets/Scripts/CardEffect/EX10/Black/EX10_035.cs

@@ -223,11 +223,6 @@ namespace DCGO.CardEffects.EX10
                 return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
             }
 
-            bool CanActivateSharedCondition(Hashtable hashtable)
-            {
-                return CardEffectCommons.IsExistOnBattleArea(card);
-            }
-
             IEnumerator SharedActivateCoroutine(Hashtable _hashtable, ActivateClass activateClass)
             {
                 if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))

+ 23 - 44
Assets/Scripts/CardEffect/EX3/Yellow/EX3_069.cs

@@ -2,6 +2,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
+// Trial of the Four Great Dragons
 namespace DCGO.CardEffects.EX3
 {
     public class EX3_069 : CEntity_Effect
@@ -10,14 +11,15 @@ namespace DCGO.CardEffects.EX3
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Main
             if (timing == EffectTiming.OptionSkill)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
-                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
                     return "[Main] <Draw 1>. Then, place this card in your battle area.";
                 }
@@ -35,32 +37,26 @@ namespace DCGO.CardEffects.EX3
                         cardEffect: activateClass));
                 }
             }
+            #endregion
 
+            #region Delay
             if (timing == EffectTiming.OnDeclaration)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play 1 Digimon from hand", CanUseCondition, card);
-                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
                     return "[Main] <Delay> (By trashing this card in your battle area, activate the effect below. You can't activate this effect the turn this card enters play.) - Play 1 Digimon card with [Four Great Dragons] in its traits from your hand without paying the cost. The Digimon played by this effect can't digivolve to level 7, and at the end of your opponent's turn, delete that Digimon.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (cardSource.EqualsTraits("Four Great Dragons"))
-                    {
-                        if (cardSource.IsDigimon)
-                        {
-                            if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
-                            {
-                                return true;
-                            }
-                        }
-                    }
-                    return false;
+                    return cardSource.EqualsTraits("Four Great Dragons")
+                        && cardSource.IsDigimon
+                        && CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -150,15 +146,8 @@ namespace DCGO.CardEffects.EX3
 
                                     bool CardCondition(CardSource cardSource)
                                     {
-                                        if (cardSource.Level == 7)
-                                        {
-                                            if (cardSource.HasLevel)
-                                            {
-                                                return true;
-                                            }
-                                        }
-
-                                        return false;
+                                        return cardSource.HasLevel
+                                            && cardSource.Level == 7;
                                     }
                                 }
 
@@ -166,33 +155,20 @@ namespace DCGO.CardEffects.EX3
                                 {
                                     ActivateClass activateClass1 = new ActivateClass();
                                     activateClass1.SetUpICardEffect("Delete the Digimon", CanUseCondition1, card);
-                                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, "");
+                                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, 1, false, "");
+                                    activateClass1.SetHashString("EX3_069_EoOT");
                                     card.Owner.UntilOpponentTurnEndEffects.Add(GetCardEffect);
 
                                     bool CanUseCondition1(Hashtable hashtable)
                                     {
-                                        if (CardEffectCommons.IsOpponentTurn(card))
-                                        {
-                                            return true;
-                                        }
-
-                                        return false;
+                                        return CardEffectCommons.IsOpponentTurn(card);
                                     }
 
                                     bool CanActivateCondition1(Hashtable hashtable)
                                     {
-                                        if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
-                                        {
-                                            if (selectedPermanent.CanBeDestroyedBySkill(activateClass1))
-                                            {
-                                                if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass1))
-                                                {
-                                                    return true;
-                                                }
-                                            }
-                                        }
-
-                                        return false;
+                                        return CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent)
+                                            && selectedPermanent.CanBeDestroyedBySkill(activateClass1)
+                                            && !selectedPermanent.TopCard.CanNotBeAffected(activateClass1);
                                     }
 
                                     IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
@@ -215,13 +191,16 @@ namespace DCGO.CardEffects.EX3
                     }
                 }
             }
+            #endregion
 
+            #region Security
             if (timing == EffectTiming.SecuritySkill)
             {
                 cardEffects.Add(CardEffectFactory.PlaceSelfDelayOptionSecurityEffect(card));
             }
+            #endregion
 
             return cardEffects;
         }
     }
-}
+}

+ 20 - 12
Assets/Scripts/CardEffect/EX4/Green/EX4_063.cs

@@ -2,6 +2,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
+// Henry Wong & Shu-Chong Wong
 namespace DCGO.CardEffects.EX4
 {
     public class EX4_063 : CEntity_Effect
@@ -10,14 +11,15 @@ namespace DCGO.CardEffects.EX4
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Start of Your Main Phase
             if (timing == EffectTiming.OnStartMainPhase)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Play 1 [Terriermon] or [Lopmon] from hand", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
                     return "[Start of Your Main Phase] If you have 1 or fewer Digimon in play, you may play 1 [Terriermon] or [Lopmon] from your hand without paying the cost. Digimon played by this effect can't digivolve and are deleted at the end of your opponent's turn.";
                 }
@@ -101,12 +103,12 @@ namespace DCGO.CardEffects.EX4
                         }
 
                         yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                                cardSources: selectedCards,
-                                                activateClass: activateClass,
-                                                payCost: false,
-                                                isTapped: false,
-                                                root: SelectCardEffect.Root.Hand,
-                                                activateETB: true));
+                            cardSources: selectedCards,
+                            activateClass: activateClass,
+                            payCost: false,
+                            isTapped: false,
+                            root: SelectCardEffect.Root.Hand,
+                            activateETB: true));
 
 
                         foreach (CardSource selectedCard in selectedCards)
@@ -142,7 +144,8 @@ namespace DCGO.CardEffects.EX4
                                 {
                                     ActivateClass activateClass1 = new ActivateClass();
                                     activateClass1.SetUpICardEffect("Delete the Digimon", CanUseCondition1, card);
-                                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, "");
+                                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, 1, false, "");
+                                    activateClass1.SetHashString("EX4_063_EoOT");
                                     card.Owner.UntilOpponentTurnEndEffects.Add(GetCardEffect);
 
                                     bool CanUseCondition1(Hashtable hashtable)
@@ -194,16 +197,18 @@ namespace DCGO.CardEffects.EX4
                     }
                 }
             }
+            #endregion
 
+            #region Your Turn
             if (timing == EffectTiming.BeforePayCost)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Digivolution Cost -1", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
                 activateClass.SetHashString("Digisorption-1_EX4_063");
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
                     return "[Your Turn] When one of your Digimon with [Terriermon] or [Lopmon] in its digivolution cards would digivolve, by suspending this Tamer, reduce the digivolution cost by 1.";
                 }
@@ -325,13 +330,16 @@ namespace DCGO.CardEffects.EX4
                     }
                 }
             }
+            #endregion
 
+            #region Security
             if (timing == EffectTiming.SecuritySkill)
             {
                 cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
             }
+            #endregion
 
             return cardEffects;
         }
     }
-}
+}

+ 77 - 101
Assets/Scripts/CardEffect/EX4/Purple/EX4_058.cs

@@ -3,6 +3,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
+// Ravemon
 namespace DCGO.CardEffects.EX4
 {
     public class EX4_058 : CEntity_Effect
@@ -11,155 +12,129 @@ namespace DCGO.CardEffects.EX4
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Jamming
             if (timing == EffectTiming.None)
             {
                 cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
             }
+            #endregion
 
+            #region End of Attack
             if (timing == EffectTiming.OnEndAttack)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Delete this Digimon to play 1 [Ravemon] from trash at the end of opponent's turn", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
                     return "[End of Attack] By deleting this Digimon that has a digivolution card with [Bird] or [Avian] in one of its traits, at the end of your opponent's turn, play 1 [Ravemon] from your trash without paying the cost.";
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    if (cardSource != null)
-                    {
-                        if (cardSource.IsDigimon)
-                        {
-                            if (cardSource.Owner == card.Owner)
-                            {
-                                if (cardSource.CardNames.Contains("Ravemon"))
-                                {
-                                    if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
-                                    {
-                                        return true;
-                                    }
-                                }
-                            }
-                        }
-                    }
-
-                    return false;
+                    return cardSource != null
+                        && cardSource.IsDigimon
+                        && cardSource.Owner == card.Owner
+                        && cardSource.CardNames.Contains("Ravemon")
+                        && CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                    return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
+                        && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (card.PermanentOfThisCard().DigivolutionCards.Count(cardSource => cardSource.HasBirdTraits) >= 1)
-                        {
-                            if (card.PermanentOfThisCard().CanBeDestroyedBySkill(activateClass))
-                            {
-                                return true;
-                            }
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass)
+                        && card.PermanentOfThisCard().DigivolutionCards.Count(cardSource => cardSource.HasBirdTraits) >= 1
+                        && card.PermanentOfThisCard().CanBeDestroyedBySkill(activateClass);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { card.PermanentOfThisCard() }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
+
+                    IEnumerator SuccessProcess()
                     {
-                        if (card.PermanentOfThisCard().DigivolutionCards.Count(cardSource => cardSource.HasBirdTraits) >= 1)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { card.PermanentOfThisCard() }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
+                        ActivateClass activateClass1 = new ActivateClass();
+                        activateClass1.SetUpICardEffect("Play 1 [Ravemon] from trash", CanUseCondition1, card);
+                        activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, 1, false, "");
+                        activateClass1.SetHashString("EX4_058_EoOT");
+                        CardEffectCommons.AddEffectToPlayer(effectDuration: EffectDuration.UntilOpponentTurnEnd, card: card, cardEffect: activateClass1, timing: EffectTiming.OnEndTurn);
 
-                            IEnumerator SuccessProcess()
-                            {
-                                ActivateClass activateClass1 = new ActivateClass();
-                                activateClass1.SetUpICardEffect("Play 1 [Ravemon] from trash", CanUseCondition1, card);
-                                activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, "");
-                                CardEffectCommons.AddEffectToPlayer(effectDuration: EffectDuration.UntilOpponentTurnEnd, card: card, cardEffect: activateClass1, timing: EffectTiming.OnEndTurn);
+                        bool CanUseCondition1(Hashtable hashtable)
+                        {
+                            return CardEffectCommons.IsOpponentTurn(card);
+                        }
 
-                                bool CanUseCondition1(Hashtable hashtable)
-                                {
-                                    return CardEffectCommons.IsOpponentTurn(card);
-                                }
+                        bool CanActivateCondition1(Hashtable hashtable)
+                        {
+                            return CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
+                        }
 
-                                bool CanActivateCondition1(Hashtable hashtable)
+                        IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
+                        {
+                            if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, (cardSource) => CanSelectCardCondition(cardSource)))
+                            {
+                                int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
+
+                                List<CardSource> selectedCards = new List<CardSource>();
+
+                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                selectCardEffect.SetUp(
+                                    canTargetCondition: CanSelectCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => false,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select 1 [Ravemon] to play.",
+                                    maxCount: maxCount,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    mode: SelectCardEffect.Mode.Custom,
+                                    root: SelectCardEffect.Root.Trash,
+                                    customRootCardList: null,
+                                    canLookReverseCard: true,
+                                    selectPlayer: card.Owner,
+                                    cardEffect: activateClass1);
+
+                                selectCardEffect.SetUpCustomMessage("Select 1 [Ravemon] to play.", "The opponent is selecting 1 [Ravemon] to play.");
+                                selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                                yield return StartCoroutine(selectCardEffect.Activate());
+
+                                IEnumerator SelectCardCoroutine(CardSource cardSource)
                                 {
-                                    if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
-                                    {
-                                        return true;
-                                    }
+                                    selectedCards.Add(cardSource);
 
-                                    return false;
+                                    yield return null;
                                 }
 
-                                IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
-                                {
-                                    if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, (cardSource) => CanSelectCardCondition(cardSource)))
-                                    {
-                                        int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
-
-                                        List<CardSource> selectedCards = new List<CardSource>();
-
-                                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                                        selectCardEffect.SetUp(
-                                                    canTargetCondition: CanSelectCardCondition,
-                                                    canTargetCondition_ByPreSelecetedList: null,
-                                                    canEndSelectCondition: null,
-                                                    canNoSelect: () => false,
-                                                    selectCardCoroutine: SelectCardCoroutine,
-                                                    afterSelectCardCoroutine: null,
-                                                    message: "Select 1 [Ravemon] to play.",
-                                                    maxCount: maxCount,
-                                                    canEndNotMax: false,
-                                                    isShowOpponent: true,
-                                                    mode: SelectCardEffect.Mode.Custom,
-                                                    root: SelectCardEffect.Root.Trash,
-                                                    customRootCardList: null,
-                                                    canLookReverseCard: true,
-                                                    selectPlayer: card.Owner,
-                                                    cardEffect: activateClass1);
-
-                                        selectCardEffect.SetUpCustomMessage("Select 1 [Ravemon] to play.", "The opponent is selecting 1 [Ravemon] to play.");
-                                        selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
-
-                                        yield return StartCoroutine(selectCardEffect.Activate());
-
-                                        IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                        {
-                                            selectedCards.Add(cardSource);
-
-                                            yield return null;
-                                        }
-
-                                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Trash, activateETB: true));
-                                    }
-                                }
-
-                                yield return null;
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Trash, activateETB: true));
                             }
                         }
+
+                        yield return null;
                     }
                 }
             }
+            #endregion
 
+            #region On Deletion
             if (timing == EffectTiming.OnDestroyedAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Opponent trashes 1 card from hand and add the top card of opponent's security to hand", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
                     return "[On Deletion] If your opponent has 8 or more cards in their hand, they trash 1 card in their hand. Then, if your opponent has 7 or fewer cards in their hand, they add the top card of their security stack to their hand.";
                 }
@@ -236,8 +211,9 @@ namespace DCGO.CardEffects.EX4
                     }
                 }
             }
+            #endregion
 
             return cardEffects;
         }
     }
-}
+}

+ 29 - 39
Assets/Scripts/CardEffect/EX4/Purple/EX4_071.cs

@@ -3,6 +3,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
+// Ame-no-Ohabari
 namespace DCGO.CardEffects.EX4
 {
     public class EX4_071 : CEntity_Effect
@@ -11,14 +12,15 @@ namespace DCGO.CardEffects.EX4
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Main
             if (timing == EffectTiming.OptionSkill)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
-                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
                     return "[Main] By deleting 1 of your Digimon, delete 1 of your opponent's Digimon whose level is less than or equal. If one of your Digimon with [Ravemon] in its name was deleted by this effect, at the end of your opponent's turn, play 1 [Ravemon] from your trash without paying the cost.";
                 }
@@ -120,7 +122,8 @@ namespace DCGO.CardEffects.EX4
                                 {
                                     ActivateClass activateClass1 = new ActivateClass();
                                     activateClass1.SetUpICardEffect("Play 1 [Ravemon] from trash", CanUseCondition1, card);
-                                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, "");
+                                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, 1, false, "");
+                                    activateClass1.SetHashString("EX4_071_EoOT");
                                     CardEffectCommons.AddEffectToPlayer(effectDuration: EffectDuration.UntilOpponentTurnEnd, card: card, cardEffect: activateClass1, timing: EffectTiming.OnEndTurn);
 
                                     bool CanUseCondition1(Hashtable hashtable)
@@ -142,65 +145,51 @@ namespace DCGO.CardEffects.EX4
                                     {
                                         if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, (cardSource) => CanSelectCardCondition(cardSource)))
                                         {
-                                            int maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardCondition(cardSource)));
-
                                             List<CardSource> selectedCards = new List<CardSource>();
 
                                             SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                                             selectCardEffect.SetUp(
-                                                        canTargetCondition: CanSelectCardCondition,
-                                                        canTargetCondition_ByPreSelecetedList: null,
-                                                        canEndSelectCondition: null,
-                                                        canNoSelect: () => false,
-                                                        selectCardCoroutine: SelectCardCoroutine,
-                                                        afterSelectCardCoroutine: null,
-                                                        message: "Select 1 [Ravemon] to play.",
-                                                        maxCount: maxCount,
-                                                        canEndNotMax: false,
-                                                        isShowOpponent: true,
-                                                        mode: SelectCardEffect.Mode.Custom,
-                                                        root: SelectCardEffect.Root.Trash,
-                                                        customRootCardList: null,
-                                                        canLookReverseCard: true,
-                                                        selectPlayer: card.Owner,
-                                                        cardEffect: activateClass1);
-
-                                            selectCardEffect.SetUpCustomMessage("Select 1 [Ravemon] to play.", "The opponent is selecting 1 [Ravemon] to play.");
-                                            selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+                                                canTargetCondition: CanSelectCardCondition,
+                                                canTargetCondition_ByPreSelecetedList: null,
+                                                canEndSelectCondition: null,
+                                                canNoSelect: () => false,
+                                                selectCardCoroutine: null,
+                                                afterSelectCardCoroutine: null,
+                                                message: "Select 1 [Ravemon] to play.",
+                                                maxCount: 1,
+                                                canEndNotMax: false,
+                                                isShowOpponent: true,
+                                                mode: SelectCardEffect.Mode.PlayForFree,
+                                                root: SelectCardEffect.Root.Trash,
+                                                customRootCardList: null,
+                                                canLookReverseCard: true,
+                                                selectPlayer: card.Owner,
+                                                cardEffect: activateClass1);
 
                                             yield return StartCoroutine(selectCardEffect.Activate());
-
-                                            IEnumerator SelectCardCoroutine(CardSource cardSource)
-                                            {
-                                                selectedCards.Add(cardSource);
-
-                                                yield return null;
-                                            }
-
-                                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Trash, activateETB: true));
                                         }
                                     }
                                 }
-
                             }
                         }
                     }
                 }
             }
+            #endregion
 
-
+            #region Security
             if (timing == EffectTiming.SecuritySkill)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect($"Delete 1 Digimon with the lowest level", CanUseCondition, card);
-                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
                 activateClass.SetIsSecurityEffect(true);
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "[Security] Delete 1 of your opponent's Digimon with the lowest level.";
+                    return "[Security] Delete 1 of your opponent's Digimon with the lowest level.";
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)
@@ -238,8 +227,9 @@ namespace DCGO.CardEffects.EX4
                     }
                 }
             }
+            #endregion
 
             return cardEffects;
         }
     }
-}
+}

+ 2 - 1
Assets/Scripts/CardEffect/EX9/Black/EX9_057.cs

@@ -55,6 +55,7 @@ namespace DCGO.CardEffects.EX9
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Return 4 Digi-Egg [Negamon] to Digi-Egg deck, to move to battle area.", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateBreedingCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsSkippable(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -394,4 +395,4 @@ namespace DCGO.CardEffects.EX9
             return cardEffects;
         }
     }
-}
+}

+ 2 - 0
Assets/Scripts/CardEffect/EX9/White/EX9_074.cs

@@ -122,6 +122,7 @@ namespace DCGO.CardEffects.EX9
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Place digimon from trash as top source card, delete digimon", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsDigimonEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -314,6 +315,7 @@ namespace DCGO.CardEffects.EX9
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Place digimon from trash as top source card, delete digimon", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetIsDigimonEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 4 - 6
Assets/Scripts/CardEffect/P/Red/P_110.cs

@@ -1,11 +1,9 @@
 using System.Collections;
 using System.Collections.Generic;
-using UnityEngine;
 using System.Linq;
-using Photon;
 using System;
-using Photon.Pun;
 
+// Shadramon
 public class P_110 : CEntity_Effect
 {
     public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
@@ -25,11 +23,11 @@ public class P_110 : CEntity_Effect
         if (timing == EffectTiming.OnEnterFieldAnyone)
         {
             ActivateClass activateClass = new ActivateClass();
-            activateClass.SetUpICardEffect("Play 1 [Veemon] or [Wormmon] from hand", CanUseCondition, card);
-            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+            activateClass.SetUpICardEffect("Play 1 [Veemon] or [Wormmon] from trash for free", CanUseCondition, card);
+            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
             cardEffects.Add(activateClass);
 
-            string EffectDiscription()
+            string EffectDescription()
             {
                 return "[When Digivolving] You may play 1 [Veemon]/[Wormmon] from your trash suspended without paying the cost.";
             }

+ 0 - 5
Assets/Scripts/CardEffect/P/Red/P_220.cs

@@ -195,11 +195,6 @@ namespace DCGO.CardEffects.P
                 return $"[{tag}] <De-Digivolve 2> 1 of your opponent's Digimon. Then, you may delete 1 Digimon.";
             }
 
-            bool SharedCanActivateCondition(Hashtable hashtable)
-            {
-                return CardEffectCommons.IsExistOnBattleArea(card);
-            }
-
             bool PermanentSelectCondition(Permanent permanent)
             {
                 return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);

+ 43 - 0
Assets/Scripts/Script/AnimatorExtensions.cs

@@ -0,0 +1,43 @@
+using UnityEngine;
+
+public static class AnimatorExtensions
+{
+    // Toggle this if you want strict original behavior vs safe behavior
+    public static bool EnableSafetyChecks = true;
+
+    public static void SafeSetInt(this Animator anim, int hash, int value)
+    {
+        if (EnableSafetyChecks)
+        {
+            if (anim == null) return;
+            if (!anim.isActiveAndEnabled) return;
+            if (anim.runtimeAnimatorController == null) return;
+        }
+
+        anim.SetInteger(hash, value);
+    }
+
+    public static void SafeSetTrigger(this Animator anim, int hash)
+    {
+        if (EnableSafetyChecks)
+        {
+            if (anim == null) return;
+            if (!anim.isActiveAndEnabled) return;
+            if (anim.runtimeAnimatorController == null) return;
+        }
+
+        anim.SetTrigger(hash);
+    }
+
+    public static void SafeSetBool(this Animator anim, int hash, bool value)
+    {
+        if (EnableSafetyChecks)
+        {
+            if (anim == null) return;
+            if (!anim.isActiveAndEnabled) return;
+            if (anim.runtimeAnimatorController == null) return;
+        }
+
+        anim.SetBool(hash, value);
+    }
+}

+ 11 - 0
Assets/Scripts/Script/AnimatorExtensions.cs.meta

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

+ 2 - 2
Assets/Scripts/Script/AttackProcess.cs

@@ -34,7 +34,7 @@ public class AttackProcess : MonoBehaviourPunCallbacks
 
     public bool ActiveAttack()
     {
-        return State != null && State != AttackState.None;
+        return State != AttackState.None;
     }
 
     public IEnumerator ProcessNextState()
@@ -287,7 +287,7 @@ public class AttackProcess : MonoBehaviourPunCallbacks
             EffectTiming.OnCounterTiming,
             cardEffect => cardEffect.IsCounterEffect));
 
-        bool HasCounterEffect(List<SkillInfo> skillInfos, SkillInfo skillInfo)
+        static bool HasCounterEffect(List<SkillInfo> skillInfos, SkillInfo skillInfo)
         {
             return skillInfos.Count((skillInfo1) => skillInfo1.CardEffect.IsCounterEffect) >= 1;
         }

+ 7 - 4
Assets/Scripts/Script/BreakGlass.cs

@@ -4,7 +4,10 @@ using DG.Tweening;
 
 public class BreakGlass : MonoBehaviour
 {
-    [SerializeField] private bool useGravity = false;                            // 重力を有効にするかどうか
+    private static WaitForSeconds _waitForSeconds0_15 = new WaitForSeconds(0.15f);
+    private static WaitForSeconds _waitForSeconds0_1 = new WaitForSeconds(0.1f);
+
+    //[SerializeField] private bool useGravity = false;                            // 重力を有効にするかどうか
     [SerializeField] internal Vector3 explodeVel = new Vector3(0, 0, 0f);      // 爆発の中心地
     [SerializeField] private float explodeForce = 75000;                         // 爆発の威力
     [SerializeField] private float explodeRange = 500;                          // 爆発の範囲
@@ -42,9 +45,9 @@ public class BreakGlass : MonoBehaviour
             rb.AddExplosionForce(explodeForce, transform.position + explodeVel, explodeRange);
         }
 
-        yield return new WaitForSeconds(0.1f);
+        yield return _waitForSeconds0_1;
 
-        if (!(this is SecurityBreakGlass))
+        if (this is not SecurityBreakGlass)
         {
             foreach (Rigidbody rb in rigidBodies)
             {
@@ -52,7 +55,7 @@ public class BreakGlass : MonoBehaviour
             }
         }
 
-        yield return new WaitForSeconds(0.15f);
+        yield return _waitForSeconds0_15;
 
         foreach (Rigidbody rb in rigidBodies)
         {

+ 0 - 1
Assets/Scripts/Script/CEntity_Base.cs

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
-using WebSocketSharp;
 using UnityEngine;
 
 [CreateAssetMenu(menuName = "Create/CEntity_Base")]

+ 1 - 3
Assets/Scripts/Script/CEntity_Effect.cs

@@ -1,10 +1,8 @@
 using Photon.Pun;
-using System;
 using System.Collections.Generic;
-using System.Collections;
 using UnityEngine;
-using System.Linq;
 
+[AddComponentMenu("")]
 public abstract partial class CEntity_Effect : MonoBehaviourPunCallbacks
 {
     public virtual List<ICardEffect> CardEffects(EffectTiming timing, CardSource cardSource)

+ 31 - 25
Assets/Scripts/Script/CardController.cs

@@ -546,10 +546,8 @@ public class PlayCardClass
                                         {
                                             yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().MoveToExecuteCardEffect(card));
                                         }
-
-                                        SelectCountEffect selectCountEffect = GManager.instance.GetComponent<SelectCountEffect>();
-
-                                        if (selectCountEffect != null)
+                                   
+                                        if (GManager.instance.TryGetComponent<SelectCountEffect>(out var selectCountEffect))
                                         {
                                             selectCountEffect.SetUp(
                                                 SelectPlayer: card.Owner,
@@ -728,10 +726,7 @@ public class PlayCardClass
                 {
                     foreach (Permanent targetPermanent in targetPermanents)
                     {
-                        if (targetPermanent != null)
-                        {
-                            targetPermanent.ShowWillEvolutionEffect();
-                        }
+                        targetPermanent?.ShowWillEvolutionEffect();
                     }
                 }
 
@@ -739,10 +734,7 @@ public class PlayCardClass
 
                 foreach (Permanent targetPermanent in targetPermanents)
                 {
-                    if (targetPermanent != null)
-                    {
-                        targetPermanent.HideWillEvolutionEffect();
-                    }
+                    targetPermanent?.HideWillEvolutionEffect();
                 }
             }
 
@@ -1066,7 +1058,7 @@ public class PlayCardClass
 
     IEnumerator OffMemoryPredictionLine()
     {
-        yield return new WaitForSeconds(0.5f);
+        yield return _waitForSeconds0_5;
 
         GManager.instance.memoryObject.OffMemoryPredictionLine();
     }
@@ -1993,6 +1985,8 @@ public class DrawClass
 
 public class IAddTrashCardsFromLibraryTop
 {
+    private static WaitForSeconds _waitForSeconds0_06 = new WaitForSeconds(0.06f);
+
     public IAddTrashCardsFromLibraryTop(int addTrashCount, Player player, ICardEffect cardEffect)
     {
         _addTrashCount = addTrashCount;
@@ -2047,7 +2041,7 @@ public class IAddTrashCardsFromLibraryTop
             for (int i = 0; i < discardedCards.Count; i++)
             {
                 ContinuousController.instance.PlaySE(GManager.instance.DrawSE);
-                yield return new WaitForSeconds(0.06f);
+                yield return _waitForSeconds0_06;
             }
 
             log += "\n";
@@ -3902,6 +3896,9 @@ public class DestroyPermanentsClass
 
 public class ISecurityCheck
 {
+    private static WaitForSeconds _waitForSeconds0_1 = new WaitForSeconds(0.1f);
+    private static WaitForSeconds _waitForSeconds0_3 = new WaitForSeconds(0.3f);
+
     public ISecurityCheck(Permanent AttackingPermanent, Player player)
     {
         this.AttackingPermanent = AttackingPermanent;
@@ -3994,7 +3991,7 @@ public class ISecurityCheck
 
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().BreakSecurityEffect(player));
 
-                        yield return new WaitForSeconds(0.1f);
+                        yield return _waitForSeconds0_1;
 
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().EnterSecurityCardEffect(brokenSecurityCard));
 
@@ -4015,9 +4012,11 @@ public class ISecurityCheck
                         {
                             if (cardEffect is ActivateICardEffect)
                             {
-                                Hashtable hashtable1 = new Hashtable();
-                                hashtable1.Add("Card", brokenSecurityCard);
-                                hashtable1.Add("isFaceDown", isFaceDown);
+                                Hashtable hashtable1 = new Hashtable
+                                {
+                                    { "Card", brokenSecurityCard },
+                                    { "isFaceDown", isFaceDown }
+                                };
 
                                 if (cardEffect.CanUse(hashtable1))
                                 {
@@ -4034,7 +4033,7 @@ public class ISecurityCheck
                         {
                             if (!brokenSecurityCard.IsDigimon)
                             {
-                                yield return new WaitForSeconds(0.3f);
+                                yield return _waitForSeconds0_3;
                                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShrinkUpUseHandCard(GManager.instance.GetComponent<Effects>().ShowUseHandCard));
                             }
                         }
@@ -4197,7 +4196,7 @@ public class ISecurityCheck
 
                                 if (doBattle)
                                 {
-                                    yield return new WaitForSeconds(0.3f);
+                                    yield return _waitForSeconds0_3;
 
                                     yield return ContinuousController.instance.StartCoroutine(new IBattle(AttackingPermanent: AttackingPermanent, DefendingPermanent: null, DefendingCard: brokenSecurityCard).Battle());
                                 }
@@ -4257,6 +4256,9 @@ public class ISecurityCheck
 
 public class IDestroySecurity
 {
+    private static WaitForSeconds _waitForSeconds0_1 = new WaitForSeconds(0.1f);
+    private static WaitForSeconds _waitForSeconds0_5 = new WaitForSeconds(0.5f);
+
     private enum TrashMode
     {
         TopSecurity,
@@ -4360,11 +4362,11 @@ public class IDestroySecurity
 
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().BreakSecurityEffect(_player));
 
-                    yield return new WaitForSeconds(0.1f);
+                    yield return _waitForSeconds0_1;
 
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().EnterSecurityCardEffect(destroyedSecurityCard));
 
-                    yield return new WaitForSeconds(0.5f);
+                    yield return _waitForSeconds0_5;
 
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().DestroySecurityEffect(destroyedSecurityCard));
 
@@ -4482,7 +4484,7 @@ public class IBattle
 
     public int CompareStats()
     {
-        int statCheck = 0;
+        int statCheck;
 
         if (AttackingPermanent.HasIceclad || DefendingPermanent.HasIceclad)
             statCheck = AttackingPermanent.DigivolutionCards.Count - DefendingPermanent.DigivolutionCards.Count;
@@ -5580,6 +5582,8 @@ public class IFlipSecurity
 
 public class SuspendPermanentsClass
 {
+    private static WaitForSeconds _waitForSeconds0_3 = new WaitForSeconds(0.3f);
+
     public SuspendPermanentsClass(List<Permanent> permanents, Hashtable hashtable)
     {
         _permanents = permanents;
@@ -5672,7 +5676,7 @@ public class SuspendPermanentsClass
 
             #endregion
 
-            yield return new WaitForSeconds(0.3f);
+            yield return _waitForSeconds0_3;
         }
     }
 }
@@ -5683,6 +5687,8 @@ public class SuspendPermanentsClass
 
 public class IUnsuspendPermanents
 {
+    private static WaitForSeconds _waitForSeconds0_3 = new WaitForSeconds(0.3f);
+
     public IUnsuspendPermanents(List<Permanent> permanents, ICardEffect cardEffect)
     {
         _permanents = permanents.Clone().Filter(CardEffectCommons.IsPermanentExistsOnBattleArea);
@@ -5778,7 +5784,7 @@ public class IUnsuspendPermanents
 
             #endregion
 
-            yield return new WaitForSeconds(0.3f);
+            yield return _waitForSeconds0_3;
         }
     }
 }

+ 19 - 21
Assets/Scripts/Script/CardEffectCommons/DNADigivolveEffects.cs

@@ -19,7 +19,7 @@ public partial class CardEffectCommons
     /// <returns>The created Permanent</returns>
     private static Permanent PlayTempPermanent(CardSource card, bool finalCard = false)
     {
-        Permanent playedPermanent = null;
+        Permanent playedPermanent;
         if (card != null)
         {
             int frameID = card.PreferredFrame().FrameID;
@@ -206,8 +206,6 @@ public partial class CardEffectCommons
 
     private static IEnumerator SelectPermanent(Player owner, CardSource jogressTarget, Permanent firstCondition, bool isOptional, ICardEffect activateClass, bool isWithHand, Func<Permanent, IEnumerator> SelectPermanentCoroutine, Func<Permanent, bool> permanentCondition = null, Func<CardSource, bool> digivolutionCardCondition = null)
     {
-        Permanent selectedPermanent = null;
-
         SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
         selectPermanentEffect.SetUp(
@@ -478,11 +476,11 @@ public partial class CardEffectCommons
             yield return null;
         }
 
-        bool CanJogressCondition(CardSource cardSource)
-        {
-            return (canSelectDNACardCondition == null || canSelectDNACardCondition(cardSource))
-                && cardSource.CanPlayJogress(true);
-        }
+        //bool CanJogressCondition(CardSource cardSource)
+        //{
+        //    return (canSelectDNACardCondition == null || canSelectDNACardCondition(cardSource))
+        //        && cardSource.CanPlayJogress(true);
+        //}
 
         if (owner.GetBattleAreaDigimons().Count < DnaPermanentCount)
         {
@@ -639,18 +637,18 @@ public partial class CardEffectCommons
 
         return jogressCondition;
 
-        bool PermanentCondition(Permanent permanent)
-        {
-            return permanent != null
-                && permanent.TopCard != null
-                && permanent.TopCard.Owner == card.Owner
-                && permanent.IsDigimon
-                && CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
-        }
-
-        bool FullPermanentCondition1(Permanent permanent) => PermanentCondition(permanent) && permanentCondition1 != null && permanentCondition1(permanent);
-
-        bool FullPermanentCondition2(Permanent permanent) => PermanentCondition(permanent) && permanentCondition2 != null && permanentCondition2(permanent);
+        //bool PermanentCondition(Permanent permanent)
+        //{
+        //    return permanent != null
+        //        && permanent.TopCard != null
+        //        && permanent.TopCard.Owner == card.Owner
+        //        && permanent.IsDigimon
+        //        && CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
+        //}
+        //
+        //bool FullPermanentCondition1(Permanent permanent) => PermanentCondition(permanent) && permanentCondition1 != null && permanentCondition1(permanent);
+        //
+        //bool FullPermanentCondition2(Permanent permanent) => PermanentCondition(permanent) && permanentCondition2 != null && permanentCondition2(permanent);
     }
 
     //Private class used to register the callback so this doesn't need to be defined in every card that uses DNA by effect
@@ -671,4 +669,4 @@ public partial class CardEffectCommons
     } 
 
     #endregion
-}
+}

+ 4 - 7
Assets/Scripts/Script/CardEffectFactory/KeyWordEffects/ArtsDigivolve.cs

@@ -1,8 +1,5 @@
 using System.Collections;
 using System.Collections.Generic;
-using System;
-using System.Linq;
-using UnityEngine;
 
 public partial class CardEffectFactory
 {
@@ -17,12 +14,12 @@ public partial class CardEffectFactory
 
         bool CanUseCondition(Hashtable hashtable) => CardEffectCommons.IsExistOnExecutingArea(card);
 
-        bool CanResolveCondition(CardSource optionCard) => CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition);
+        bool CanResolveCondition(CardSource optionCard) => CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition, true);
 
         bool CanSelectPermanentCondition(Permanent permanent)
         {
-            return (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
-                    || CardEffectCommons.IsPermanentExistsOnOwnerBreedingArea(permanent, card))
+            return CardEffectCommons.IsOwnerPermanent(permanent, card)
+                && permanent.IsDigimon
                 && card.CanPlayCardTargetFrame(permanent.PermanentFrame, false, artsDigivolutionClass, SelectCardEffect.Root.Execution);
         }
         
@@ -61,4 +58,4 @@ public partial class CardEffectFactory
         }
     }
     #endregion
-}
+}

+ 1 - 1
Assets/Scripts/Script/CardEffects/DisableEffectClass.cs

@@ -12,7 +12,7 @@ public class DisableEffectClass : ICardEffect, IDisableCardEffect
         this.DisableCondition = DisableCondition;
     }
 
-    public bool IsDisabled(ICardEffect cardEffect)
+    public new bool IsDisabled(ICardEffect cardEffect)
     {
         if (DisableCondition(cardEffect))
         {

+ 15 - 12
Assets/Scripts/Script/CardImagePanel.cs

@@ -1,4 +1,4 @@
-using System.Collections;
+�ソusing System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using TMPro;
@@ -7,6 +7,9 @@ using UnityEngine.Events;
 
 public class CardImagePanel : OffAnimation
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
+    private static WaitForSeconds _waitForSeconds0_25 = new WaitForSeconds(0.25f);
     [SerializeField] TextMeshProUGUI _infoText;
     [SerializeField] TMP_InputField _cardIDsInput;
     [SerializeField] GameObject _lackCardImagesObject;
@@ -41,13 +44,13 @@ public class CardImagePanel : OffAnimation
     {
         _isOpen = true;
         gameObject.SetActive(true);
-        _anim.SetInteger("Open", 1);
-        _anim.SetInteger("Close", 0);
-        _lackCardImagesObject.gameObject.SetActive(false);
+        _anim.SafeSetInt(OpenHash, 1);
+        _anim.SafeSetInt(CloseHash, 0);
+        _lackCardImagesObject.SetActive(false);
         _infoText.text = "";
         _cardIDsInput.text = "";
 
-        yield return new WaitForSeconds(0.25f);
+        yield return _waitForSeconds0_25;
 
         List<CEntity_Base> lackCardImageCardEntities = ContinuousController.instance.CardList
         .Filter(cEntity_Base => !StreamingAssetsUtility.IsCardExists(cEntity_Base)).ToList();
@@ -56,10 +59,10 @@ public class CardImagePanel : OffAnimation
         {
             _infoText.text = LocalizeUtility.GetLocalizedString(
                                 EngMessage: $"The following {lackCardImageCardEntities.Count} card images are not set.",
-                                JpnMessage: $"以下の {lackCardImageCardEntities.Count}枚の\nカード画像がセットされていません。"
+                                JpnMessage: $"莉・荳九� {lackCardImageCardEntities.Count}譫壹�\n繧ォ繝シ繝臥判蜒上′繧サ繝�ヨ縺輔l縺ヲ縺�∪縺帙s縲�"
                             );
 
-            _lackCardImagesObject.gameObject.SetActive(true);
+            _lackCardImagesObject.SetActive(true);
 
             _cardIDsInput.text = string.Join(", ", lackCardImageCardEntities.Map(cEntity_Base => cEntity_Base.CardSpriteName));
         }
@@ -68,7 +71,7 @@ public class CardImagePanel : OffAnimation
         {
             _infoText.text = LocalizeUtility.GetLocalizedString(
                                 EngMessage: "All card images are set.",
-                                JpnMessage: "カード画像は全てセットされています。"
+                                JpnMessage: "繧ォ繝シ繝臥判蜒上�蜈ィ縺ヲ繧サ繝�ヨ縺輔l縺ヲ縺�∪縺吶€�"
                             );
         }
     }
@@ -106,8 +109,8 @@ public class CardImagePanel : OffAnimation
             }
         }
 
-        _anim.SetInteger("Open", 0);
-        _anim.SetInteger("Close", 1);
+        _anim.SafeSetInt(OpenHash, 0);
+        _anim.SafeSetInt(CloseHash, 1);
     }
 
     public void OnClickCopyButton()
@@ -129,8 +132,8 @@ public class CardImagePanel : OffAnimation
             CommandTexts,
             LocalizeUtility.GetLocalizedString(
             EngMessage: "The list of card image names has been copied to the clipboard!",
-            JpnMessage: "カード画像名一覧を\nクリップボードにコピーしました!"
+            JpnMessage: "繧ォ繝シ繝臥判蜒丞錐荳€隕ァ繧箪n繧ッ繝ェ繝��繝懊�繝峨↓繧ウ繝斐�縺励∪縺励◆!"
         ),
             true);
     }
-}
+}

+ 32 - 29
Assets/Scripts/Script/CardPrefab_CreateDeck.cs

@@ -209,7 +209,7 @@ public class CardPrefab_CreateDeck : MonoBehaviour
                 {
                     for (int i = CostIcons.Count-1; i > -1; i--)
                     {
-                        CardColor cardColor = CardColor.None;
+                        CardColor cardColor;
                         int value = CostIcons.Count - i - 1;
 
                         if (i >= CostIcons.Count - cEntity_Base.cardColors.Count)
@@ -248,8 +248,7 @@ public class CardPrefab_CreateDeck : MonoBehaviour
                     {
                         for (int i = 0; i < CostIcons.Count; i++)
                         {
-                            int cardColorIndex = i < cEntity_Base.cardColors.Count ? i : 0;
-                            CardColor cardColor = cEntity_Base.cardColors[cardColorIndex];
+                            CardColor cardColor;
 
                             if (i < cEntity_Base.cardColors.Count)
                             {
@@ -289,7 +288,7 @@ public class CardPrefab_CreateDeck : MonoBehaviour
                                 EvoCostIcons[i].sprite = WhiteCircle;
                                 EvoCostIcons[i].transform.parent.gameObject.SetActive(true);
 
-                                CardColor cardColor = CardColor.None;
+                                CardColor cardColor;
 
                                 cardColor = cEntity_Base.EvoCosts[i].CardColor;
 
@@ -533,9 +532,11 @@ public class CardPrefab_CreateDeck : MonoBehaviour
             bool isRay = false;
 
             List<RaycastResult> results = new List<RaycastResult>();
-            PointerEventData pointer = new PointerEventData(EventSystem.current);
-            // マウスポインタの位置にレイ飛ばし、ヒットしたものを保存
-            pointer.position = Input.mousePosition;
+            PointerEventData pointer = new PointerEventData(EventSystem.current)
+            {
+                // マウスポインタの位置にレイ飛ばし、ヒットしたものを保存
+                position = Input.mousePosition
+            };
             EventSystem.current.RaycastAll(pointer, results);
             // ヒットしたUIの名前
             foreach (RaycastResult target in results)
@@ -573,25 +574,25 @@ public class CardPrefab_CreateDeck : MonoBehaviour
         return;
 #endif
         return;
-        bool isRay = false;
-
-        List<RaycastResult> results = new List<RaycastResult>();
-        PointerEventData pointer = new PointerEventData(EventSystem.current);
-        // マウスポインタの位置にレイ飛ばし、ヒットしたものを保存
-        pointer.position = Input.mousePosition;
-        EventSystem.current.RaycastAll(pointer, results);
-        // ヒットしたUIの名前
-        foreach (RaycastResult target in results)
-        {
-            if (target.gameObject == AddButton.gameObject || target.gameObject == RemoveButton.gameObject)
-            {
-                return;
-            }
-        }
-
-        _OnExit();
-
-        //StartCoroutine(OnExitCoroutine());
+        //bool isRay = false;
+
+        //List<RaycastResult> results = new List<RaycastResult>();
+        //PointerEventData pointer = new PointerEventData(EventSystem.current);
+        //// マウスポインタの位置にレイ飛ばし、ヒットしたものを保存
+        //pointer.position = Input.mousePosition;
+        //EventSystem.current.RaycastAll(pointer, results);
+        //// ヒットしたUIの名前
+        //foreach (RaycastResult target in results)
+        //{
+        //    if (target.gameObject == AddButton.gameObject || target.gameObject == RemoveButton.gameObject)
+        //    {
+        //        return;
+        //    }
+        //}
+
+        //_OnExit();
+
+        ////StartCoroutine(OnExitCoroutine());
     }
 
     IEnumerator OnExitCoroutine()
@@ -603,9 +604,11 @@ public class CardPrefab_CreateDeck : MonoBehaviour
             bool isRay = false;
 
             List<RaycastResult> results = new List<RaycastResult>();
-            PointerEventData pointer = new PointerEventData(EventSystem.current);
-            // マウスポインタの位置にレイ飛ばし、ヒットしたものを保存
-            pointer.position = Input.mousePosition;
+            PointerEventData pointer = new PointerEventData(EventSystem.current)
+            {
+                // マウスポインタの位置にレイ飛ばし、ヒットしたものを保存
+                position = Input.mousePosition
+            };
             EventSystem.current.RaycastAll(pointer, results);
             // ヒットしたUIの名前
             foreach (RaycastResult target in results)

+ 0 - 3
Assets/Scripts/Script/CommandPanel.cs

@@ -1,4 +1,3 @@
-using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
@@ -17,12 +16,10 @@ public class CommandPanel : MonoBehaviour
     [Header("ƒ{ƒ^ƒ“�e")]
     [SerializeField] Transform buttonParent;
 
-    bool first = false;
     private void Start()
     {
         if (!false)
         {
-            first = true;
 
 #if !UNITY_EDITOR && UNITY_ANDROID
             CommandPanelObject.transform.localScale *= 1.5f;

+ 291 - 327
Assets/Scripts/Script/ContinuousController.cs

@@ -12,8 +12,10 @@ using UnityEngine.Networking;
 using UnityEngine.SceneManagement;
 using Hashtable = ExitGames.Client.Photon.Hashtable;
 
+[RequireComponent(typeof(StarterDeck))]
 public class ContinuousController : MonoBehaviour
 {
+    private static WaitForSeconds _waitForSeconds0_1 = new WaitForSeconds(0.1f);
     [Header("game language")]
     // public Language language;
 
@@ -150,357 +152,325 @@ public class ContinuousController : MonoBehaviour
 
     async Task CreateTokenData()
     {
-        DiaboromonToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.White },
-            PlayCost = 14,
-            Level = 6,
-            CardName_JPN = "ディアボロモン",
-            CardName_ENG = "Diaboromon",
-            Form_JPN = new List<string>() { "究極体" },
-            Form_ENG = new List<string>() { "Mega" },
-            Attribute_JPN = new List<string>() { "不明" },
-            Attribute_ENG = new List<string>() { "Unknown" },
-            Type_JPN = new List<string>() { "種族不明" },
-            Type_ENG = new List<string>() { "Unidentified" },
-            CardSpriteName = "BT2-082-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 3000,
-        };
+        DiaboromonToken = ScriptableObject.CreateInstance<CEntity_Base>();
+
+        DiaboromonToken.cardColors = new List<CardColor>() { CardColor.White };
+        DiaboromonToken.PlayCost = 14;
+        DiaboromonToken.Level = 6;
+        DiaboromonToken.CardName_JPN = "ディアボロモン";
+        DiaboromonToken.CardName_ENG = "Diaboromon";
+        DiaboromonToken.Form_JPN = new List<string>() { "究極体" };
+        DiaboromonToken.Form_ENG = new List<string>() { "Mega" };
+        DiaboromonToken.Attribute_JPN = new List<string>() { "不明" };
+        DiaboromonToken.Attribute_ENG = new List<string>() { "Unknown" };
+        DiaboromonToken.Type_JPN = new List<string>() { "種族不明" };
+        DiaboromonToken.Type_ENG = new List<string>() { "Unidentified" };
+        DiaboromonToken.CardSpriteName = "BT2-082-token";
+        DiaboromonToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        DiaboromonToken.DP = 3000;
 
         await DiaboromonToken.GetCardSprite();
 
-        AmonToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Red },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "紅炎のアモン",
-            CardName_ENG = "Amon of Crimson Flame",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT14-018-token-red",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 6000,
-            CardEffectClassName = "BT4_038"
-        };
+        AmonToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        AmonToken.cardColors = new List<CardColor>() { CardColor.Red };
+        AmonToken.PlayCost = -1;
+        AmonToken.Level = 0;
+        AmonToken.CardName_JPN = "紅炎のアモン";
+        AmonToken.CardName_ENG = "Amon of Crimson Flame";
+        AmonToken.Form_JPN = new List<string>();
+        AmonToken.Form_ENG = new List<string>();
+        AmonToken.Attribute_JPN = new List<string>();
+        AmonToken.Attribute_ENG = new List<string>();
+        AmonToken.Type_JPN = new List<string>();
+        AmonToken.Type_ENG = new List<string>();
+        AmonToken.CardSpriteName = "BT14-018-token-red";
+        AmonToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        AmonToken.DP = 6000;
+        AmonToken.CardEffectClassName = "BT4_038";
 
         await AmonToken.GetCardSprite();
 
-        UmonToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Yellow },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "蒼雷のウモン",
-            CardName_ENG = "Umon of Blue Thunder",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT14-018-token-yellow",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 6000,
-            CardEffectClassName = "BT1_031"
-        };
+        UmonToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        UmonToken.cardColors = new List<CardColor>() { CardColor.Yellow };
+        UmonToken.PlayCost = -1;
+        UmonToken.Level = 0;
+        UmonToken.CardName_JPN = "蒼雷のウモン";
+        UmonToken.CardName_ENG = "Umon of Blue Thunder";
+        UmonToken.Form_JPN = new List<string>();
+        UmonToken.Form_ENG = new List<string>();
+        UmonToken.Attribute_JPN = new List<string>();
+        UmonToken.Attribute_ENG = new List<string>();
+        UmonToken.Type_JPN = new List<string>();
+        UmonToken.Type_ENG = new List<string>();
+        UmonToken.CardSpriteName = "BT14-018-token-yellow";
+        UmonToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        UmonToken.DP = 6000;
+        UmonToken.CardEffectClassName = "BT1_031";
 
         await UmonToken.GetCardSprite();
 
-        FujitsumonToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Purple },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "フジツモン",
-            CardName_ENG = "Fujitsumon",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "EX5-058-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 3000,
-            CardEffectClassName = "EX5_058_token"
-        };
+        FujitsumonToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        FujitsumonToken.cardColors = new List<CardColor>() { CardColor.Purple };
+        FujitsumonToken.PlayCost = -1;
+        FujitsumonToken.Level = 0;
+        FujitsumonToken.CardName_JPN = "フジツモン";
+        FujitsumonToken.CardName_ENG = "Fujitsumon";
+        FujitsumonToken.Form_JPN = new List<string>();
+        FujitsumonToken.Form_ENG = new List<string>();
+        FujitsumonToken.Attribute_JPN = new List<string>();
+        FujitsumonToken.Attribute_ENG = new List<string>();
+        FujitsumonToken.Type_JPN = new List<string>();
+        FujitsumonToken.Type_ENG = new List<string>();
+        FujitsumonToken.CardSpriteName = "EX5-058-token";
+        FujitsumonToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        FujitsumonToken.DP = 3000;
+        FujitsumonToken.CardEffectClassName = "EX5_058_token";
 
         await FujitsumonToken.GetCardSprite();
 
-        GyuukimonToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Purple },
-            PlayCost = 7,
-            Level = 5,
-            CardName_JPN = "ギュウキモン",
-            CardName_ENG = "Gyuukimon",
-            Form_JPN = new List<string>() { "究極の" },
-            Form_ENG = new List<string>() { "Ultimate" },
-            Attribute_JPN = new List<string>() { "ウイルス" },
-            Attribute_ENG = new List<string>() { "Virus" },
-            Type_JPN = new List<string>() { "ダークアニマル" },
-            Type_ENG = new List<string>() { "Dark Animal" },
-            CardSpriteName = "LM-018-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 3000,
-        };
+        GyuukimonToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        GyuukimonToken.cardColors = new List<CardColor>() { CardColor.Purple };
+        GyuukimonToken.PlayCost = 7;
+        GyuukimonToken.Level = 5;
+        GyuukimonToken.CardName_JPN = "ギュウキモン";
+        GyuukimonToken.CardName_ENG = "Gyuukimon";
+        GyuukimonToken.Form_JPN = new List<string>() { "究極の" };
+        GyuukimonToken.Form_ENG = new List<string>() { "Ultimate" };
+        GyuukimonToken.Attribute_JPN = new List<string>() { "ウイルス" };
+        GyuukimonToken.Attribute_ENG = new List<string>() { "Virus" };
+        GyuukimonToken.Type_JPN = new List<string>() { "ダークアニマル" };
+        GyuukimonToken.Type_ENG = new List<string>() { "Dark Animal" };
+        GyuukimonToken.CardSpriteName = "LM-018-token";
+        GyuukimonToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        GyuukimonToken.DP = 3000;
+        GyuukimonToken.CardEffectClassName = "LM_018_token";
 
         await GyuukimonToken.GetCardSprite();
 
-        KoHagurumonToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Black },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "KoHagurumon",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT16-052-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 1000,
-            CardEffectClassName = "BT16_052_token"
-        };
+        KoHagurumonToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        KoHagurumonToken.cardColors = new List<CardColor>() { CardColor.Black };
+        KoHagurumonToken.PlayCost = -1;
+        KoHagurumonToken.Level = 0;
+        KoHagurumonToken.CardName_JPN = "";
+        KoHagurumonToken.CardName_ENG = "KoHagurumon";
+        KoHagurumonToken.Form_JPN = new List<string>();
+        KoHagurumonToken.Form_ENG = new List<string>();
+        KoHagurumonToken.Attribute_JPN = new List<string>();
+        KoHagurumonToken.Attribute_ENG = new List<string>();
+        KoHagurumonToken.Type_JPN = new List<string>();
+        KoHagurumonToken.Type_ENG = new List<string>();
+        KoHagurumonToken.CardSpriteName = "BT16-052-token";
+        KoHagurumonToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        KoHagurumonToken.DP = 1000;
+        KoHagurumonToken.CardEffectClassName = "BT16_052_token";
 
         await KoHagurumonToken.GetCardSprite();
         
-        FamiliarToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Yellow },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "Familiar",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "EX7-030-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 3000,
-            CardEffectClassName = "EX7_030_token"
-        };
+        FamiliarToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        FamiliarToken.cardColors = new List<CardColor>() { CardColor.Yellow };
+        FamiliarToken.PlayCost = -1;
+        FamiliarToken.Level = 0;
+        FamiliarToken.CardName_JPN = "";
+        FamiliarToken.CardName_ENG = "Familiar";
+        FamiliarToken.Form_JPN = new List<string>();
+        FamiliarToken.Form_ENG = new List<string>();
+        FamiliarToken.Attribute_JPN = new List<string>();
+        FamiliarToken.Attribute_ENG = new List<string>();
+        FamiliarToken.Type_JPN = new List<string>();
+        FamiliarToken.Type_ENG = new List<string>();
+        FamiliarToken.CardSpriteName = "EX7-030-token";
+        FamiliarToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        FamiliarToken.DP = 3000;
+        FamiliarToken.CardEffectClassName = "EX7_030_token";
 
         await FamiliarToken.GetCardSprite();
         
-        SelfDeleteFamiliarToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Yellow },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "Familiar",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "EX7-030-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 3000,
-            CardEffectClassName = "P_165_token"
-        };
+        SelfDeleteFamiliarToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        SelfDeleteFamiliarToken.cardColors = new List<CardColor>() { CardColor.Yellow };
+        SelfDeleteFamiliarToken.PlayCost = -1;
+        SelfDeleteFamiliarToken.Level = 0;
+        SelfDeleteFamiliarToken.CardName_JPN = "";
+        SelfDeleteFamiliarToken.CardName_ENG = "Familiar";
+        SelfDeleteFamiliarToken.Form_JPN = new List<string>();
+        SelfDeleteFamiliarToken.Form_ENG = new List<string>();
+        SelfDeleteFamiliarToken.Attribute_JPN = new List<string>();
+        SelfDeleteFamiliarToken.Attribute_ENG = new List<string>();
+        SelfDeleteFamiliarToken.Type_JPN = new List<string>();
+        SelfDeleteFamiliarToken.Type_ENG = new List<string>();
+        SelfDeleteFamiliarToken.CardSpriteName = "EX7-030-token";
+        SelfDeleteFamiliarToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        SelfDeleteFamiliarToken.DP = 3000;
+        SelfDeleteFamiliarToken.CardEffectClassName = "P_165_token";
 
         await SelfDeleteFamiliarToken.GetCardSprite();
 
-        VoleeZerdruckenToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Purple },
-            PlayCost = -1,
-            Level = 4,
-            CardName_JPN = "",
-            CardName_ENG = "Volée & Zerdrücken",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "EX7-058-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 5000,
-            CardEffectClassName = "EX7_058_token"
-        };
+        VoleeZerdruckenToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        VoleeZerdruckenToken.cardColors = new List<CardColor>() { CardColor.Purple };
+        VoleeZerdruckenToken.PlayCost = -1;
+        VoleeZerdruckenToken.Level = 4;
+        VoleeZerdruckenToken.CardName_JPN = "";
+        VoleeZerdruckenToken.CardName_ENG = "Volée & Zerdrücken";
+        VoleeZerdruckenToken.Form_JPN = new List<string>();
+        VoleeZerdruckenToken.Form_ENG = new List<string>();
+        VoleeZerdruckenToken.Attribute_JPN = new List<string>();
+        VoleeZerdruckenToken.Attribute_ENG = new List<string>();
+        VoleeZerdruckenToken.Type_JPN = new List<string>();
+        VoleeZerdruckenToken.Type_ENG = new List<string>();
+        VoleeZerdruckenToken.CardSpriteName = "EX7-058-token";
+        VoleeZerdruckenToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        VoleeZerdruckenToken.DP = 5000;
+        VoleeZerdruckenToken.CardEffectClassName = "EX7_058_token";
 
         await VoleeZerdruckenToken.GetCardSprite();
 
-        UkaNoMitamaToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Yellow },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "Uka-no-Mitama",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "EX8-037-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 9000,
-            CardEffectClassName = "EX8_037_token"
-        };
+        UkaNoMitamaToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        UkaNoMitamaToken.cardColors = new List<CardColor>() { CardColor.Yellow };
+        UkaNoMitamaToken.PlayCost = -1;
+        UkaNoMitamaToken.Level = 0;
+        UkaNoMitamaToken.CardName_JPN = "";
+        UkaNoMitamaToken.CardName_ENG = "Uka-no-Mitama";
+        UkaNoMitamaToken.Form_JPN = new List<string>();
+        UkaNoMitamaToken.Form_ENG = new List<string>();
+        UkaNoMitamaToken.Attribute_JPN = new List<string>();
+        UkaNoMitamaToken.Attribute_ENG = new List<string>();
+        UkaNoMitamaToken.Type_JPN = new List<string>();
+        UkaNoMitamaToken.Type_ENG = new List<string>();
+        UkaNoMitamaToken.CardSpriteName = "EX8-037-token";
+        UkaNoMitamaToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        UkaNoMitamaToken.DP = 9000;
+        UkaNoMitamaToken.CardEffectClassName = "EX8_037_token";
 
         await UkaNoMitamaToken.GetCardSprite();
 
-        WarGrowlmonToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Red },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "WarGrowlmon",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT19-091-token-red",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 6000
-        };
+        WarGrowlmonToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        WarGrowlmonToken.cardColors = new List<CardColor>() { CardColor.Red };
+        WarGrowlmonToken.PlayCost = -1;
+        WarGrowlmonToken.Level = 0;
+        WarGrowlmonToken.CardName_JPN = "";
+        WarGrowlmonToken.CardName_ENG = "WarGrowlmon";
+        WarGrowlmonToken.Form_JPN = new List<string>();
+        WarGrowlmonToken.Form_ENG = new List<string>();
+        WarGrowlmonToken.Attribute_JPN = new List<string>();
+        WarGrowlmonToken.Attribute_ENG = new List<string>();
+        WarGrowlmonToken.Type_JPN = new List<string>();
+        WarGrowlmonToken.Type_ENG = new List<string>();
+        WarGrowlmonToken.CardSpriteName = "BT19-091-token-red";
+        WarGrowlmonToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        WarGrowlmonToken.DP = 6000;
 
         await WarGrowlmonToken.GetCardSprite();
 
-        TaomonToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Yellow },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "Taomon",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT19-091-token-yellow",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 6000
-        };
+        TaomonToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        TaomonToken.cardColors = new List<CardColor>() { CardColor.Yellow };
+        TaomonToken.PlayCost = -1;
+        TaomonToken.Level = 0;
+        TaomonToken.CardName_JPN = "";
+        TaomonToken.CardName_ENG = "Taomon";
+        TaomonToken.Form_JPN = new List<string>();
+        TaomonToken.Form_ENG = new List<string>();
+        TaomonToken.Attribute_JPN = new List<string>();
+        TaomonToken.Attribute_ENG = new List<string>();
+        TaomonToken.Type_JPN = new List<string>();
+        TaomonToken.Type_ENG = new List<string>();
+        TaomonToken.CardSpriteName = "BT19-091-token-yellow";
+        TaomonToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        TaomonToken.DP = 6000;
 
         await TaomonToken.GetCardSprite();
         
-        RapidmonToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Green },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "Rapidmon",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT19-091-token-green",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 6000
-        };
+        RapidmonToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        RapidmonToken.cardColors = new List<CardColor>() { CardColor.Green };
+        RapidmonToken.PlayCost = -1;
+        RapidmonToken.Level = 0;
+        RapidmonToken.CardName_JPN = "";
+        RapidmonToken.CardName_ENG = "Rapidmon";
+        RapidmonToken.Form_JPN = new List<string>();
+        RapidmonToken.Form_ENG = new List<string>();
+        RapidmonToken.Attribute_JPN = new List<string>();
+        RapidmonToken.Attribute_ENG = new List<string>();
+        RapidmonToken.Type_JPN = new List<string>();
+        RapidmonToken.Type_ENG = new List<string>();
+        RapidmonToken.CardSpriteName = "BT19-091-token-green";
+        RapidmonToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        RapidmonToken.DP = 6000;
 
         await RapidmonToken.GetCardSprite();
 
-        PipeFoxToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.Yellow },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "Pipe-Fox",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT19-040-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 6000,
-            CardEffectClassName = "BT19_040_token"
-        };
+        PipeFoxToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        PipeFoxToken.cardColors = new List<CardColor>() { CardColor.Yellow };
+        PipeFoxToken.PlayCost = -1;
+        PipeFoxToken.Level = 0;
+        PipeFoxToken.CardName_JPN = "";
+        PipeFoxToken.CardName_ENG = "Pipe-Fox";
+        PipeFoxToken.Form_JPN = new List<string>();
+        PipeFoxToken.Form_ENG = new List<string>();
+        PipeFoxToken.Attribute_JPN = new List<string>();
+        PipeFoxToken.Attribute_ENG = new List<string>();
+        PipeFoxToken.Type_JPN = new List<string>();
+        PipeFoxToken.Type_ENG = new List<string>();
+        PipeFoxToken.CardSpriteName = "BT19-040-token";
+        PipeFoxToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        PipeFoxToken.DP = 6000;
+        PipeFoxToken.CardEffectClassName = "BT19_040_token";
 
         await PipeFoxToken.GetCardSprite();
 
-        AthoRenePorToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.White },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "Atho, René & Por",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT20-017-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 6000,
-            CardEffectClassName = "BT20_017_token"
-        };
+        AthoRenePorToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        AthoRenePorToken.cardColors = new List<CardColor>() { CardColor.White };
+        AthoRenePorToken.PlayCost = -1;
+        AthoRenePorToken.Level = 0;
+        AthoRenePorToken.CardName_JPN = "";
+        AthoRenePorToken.CardName_ENG = "Atho, René & Por";
+        AthoRenePorToken.Form_JPN = new List<string>();
+        AthoRenePorToken.Form_ENG = new List<string>();
+        AthoRenePorToken.Attribute_JPN = new List<string>();
+        AthoRenePorToken.Attribute_ENG = new List<string>();
+        AthoRenePorToken.Type_JPN = new List<string>();
+        AthoRenePorToken.Type_ENG = new List<string>();
+        AthoRenePorToken.CardSpriteName = "BT20-017-token";
+        AthoRenePorToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        AthoRenePorToken.DP = 6000;
+        AthoRenePorToken.CardEffectClassName = "BT20_017_token";
 
         await AthoRenePorToken.GetCardSprite();
 
-        HinukamuyToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.White },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "HinukamuyToken",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT23-057-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 6000,
-            CardEffectClassName = "BT23_057_token"
-        };
+        HinukamuyToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        HinukamuyToken.cardColors = new List<CardColor>() { CardColor.White };
+        HinukamuyToken.PlayCost = -1;
+        HinukamuyToken.Level = 0;
+        HinukamuyToken.CardName_JPN = "";
+        HinukamuyToken.CardName_ENG = "HinukamuyToken";
+        HinukamuyToken.Form_JPN = new List<string>();
+        HinukamuyToken.Form_ENG = new List<string>();
+        HinukamuyToken.Attribute_JPN = new List<string>();
+        HinukamuyToken.Attribute_ENG = new List<string>();
+        HinukamuyToken.Type_JPN = new List<string>();
+        HinukamuyToken.Type_ENG = new List<string>();
+        HinukamuyToken.CardSpriteName = "BT23-057-token";
+        HinukamuyToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        HinukamuyToken.DP = 6000;
+        HinukamuyToken.CardEffectClassName = "BT23_057_token";
 
         await HinukamuyToken.GetCardSprite();
 
         
 
-        PetrificationToken = new CEntity_Base()
-        {
-            cardColors = new List<CardColor>() { CardColor.White },
-            PlayCost = -1,
-            Level = 0,
-            CardName_JPN = "",
-            CardName_ENG = "Petrification",
-            Form_JPN = new List<string>(),
-            Form_ENG = new List<string>(),
-            Attribute_JPN = new List<string>(),
-            Attribute_ENG = new List<string>(),
-            Type_JPN = new List<string>(),
-            Type_ENG = new List<string>(),
-            CardSpriteName = "BT21-029-token",
-            cardKind = new List<CardKind> { CardKind.Digimon },
-            DP = 3000,
-            CardEffectClassName = "BT21_029_token"
-        };
+        PetrificationToken = ScriptableObject.CreateInstance<CEntity_Base>();
+        PetrificationToken.cardColors = new List<CardColor>() { CardColor.White };
+        PetrificationToken.PlayCost = -1;
+        PetrificationToken.Level = 0;
+        PetrificationToken.CardName_JPN = "";
+        PetrificationToken.CardName_ENG = "Petrification";
+        PetrificationToken.Form_JPN = new List<string>();
+        PetrificationToken.Form_ENG = new List<string>();
+        PetrificationToken.Attribute_JPN = new List<string>();
+        PetrificationToken.Attribute_ENG = new List<string>();
+        PetrificationToken.Type_JPN = new List<string>();
+        PetrificationToken.Type_ENG = new List<string>();
+        PetrificationToken.CardSpriteName = "BT21-029-token";
+        PetrificationToken.cardKind = new List<CardKind> { CardKind.Digimon };
+        PetrificationToken.DP = 3000;
+        PetrificationToken.CardEffectClassName = "BT21_029_token";
 
         await PetrificationToken.GetCardSprite();
     }
@@ -681,7 +651,7 @@ public class ContinuousController : MonoBehaviour
 
             sr.Close();
 
-            string deck = deckList.Substring(deckList.IndexOf("//"));
+            string deck = deckList[deckList.IndexOf("//")..];
             //Debug.Log(deckName);
 
             if(SortValue < 0)
@@ -895,7 +865,7 @@ public class ContinuousController : MonoBehaviour
     #endregion
 
     #region Show CutIn Animation
-    [HideInInspector] public bool showCutInAnimation = false;
+    public bool showCutInAnimation = false;
     string _showCutInAnimationKey = "ShowCutInAnimation";
 
     public void SaveShowCutInAnimation()
@@ -1204,7 +1174,7 @@ public class ContinuousController : MonoBehaviour
         {
             Debug.Log("Unload from Room Match");
             yield return StartCoroutine(Opening.instance.battle.roomManager.Init(true));
-            yield return new WaitForSeconds(0.1f);
+            yield return _waitForSeconds0_1;
         }
 
         yield return new WaitWhile(() => GManager.instance != null);
@@ -1235,7 +1205,7 @@ public class ContinuousController : MonoBehaviour
 
         for (int i = 0; i < 3; i++)
         {
-            yield return new WaitForSeconds(0.1f);
+            yield return _waitForSeconds0_1;
 
             EventSystem.current.SetSelectedGameObject(Opening.instance.battle.selectBattleMode.transform.GetChild(0).gameObject);
         }
@@ -1427,11 +1397,13 @@ public class ContinuousController : MonoBehaviour
     {
         if (!string.IsNullOrEmpty(PhotonUtility.RetryStatus))
         {
-            GUIStyle retryStyle = new GUIStyle(GUI.skin.label);
-            retryStyle.fontSize = 20;
-            retryStyle.richText = true;
-            retryStyle.fontStyle = FontStyle.Bold;
-            retryStyle.alignment = TextAnchor.MiddleCenter;
+            GUIStyle retryStyle = new GUIStyle(GUI.skin.label)
+            {
+                fontSize = 20,
+                richText = true,
+                fontStyle = FontStyle.Bold,
+                alignment = TextAnchor.MiddleCenter
+            };
 
             float boxW = 500;
             float boxH = 40;
@@ -1465,10 +1437,12 @@ public class ContinuousController : MonoBehaviour
             status = $"<color=#FFAA00>[Photon] Connected | Region: {PhotonNetwork.CloudRegion} | Not in Lobby/Room</color>";
         }
 
-        GUIStyle style = new GUIStyle(GUI.skin.label);
-        style.fontSize = 16;
-        style.richText = true;
-        style.fontStyle = FontStyle.Bold;
+        GUIStyle style = new GUIStyle(GUI.skin.label)
+        {
+            fontSize = 16,
+            richText = true,
+            fontStyle = FontStyle.Bold
+        };
 
         GUI.Label(new Rect(10, 10, 800, 30), status, style);
     }
@@ -1534,9 +1508,7 @@ public static class RandomUtility
             int k = GameRandom.Range(0, n + 1);
 
             // Swap elements at indices n and k
-            CEntity_Base temp = CardDatas[n];
-            CardDatas[n] = CardDatas[k];
-            CardDatas[k] = temp;
+            (CardDatas[k], CardDatas[n]) = (CardDatas[n], CardDatas[k]);
         }
 
 
@@ -1690,11 +1662,7 @@ public class PhotonUtility
         #region Save the number of wins to a custom property
         Hashtable hash = PhotonNetwork.LocalPlayer.CustomProperties;
 
-        object value;
-
-        hash = PhotonNetwork.LocalPlayer.CustomProperties;
-
-        if (hash.TryGetValue(ContinuousController.WinCountKey, out value))
+        if (hash.TryGetValue(ContinuousController.WinCountKey, out object value))
         {
             hash[ContinuousController.WinCountKey] = ContinuousController.instance.WinCount;
         }
@@ -1741,11 +1709,7 @@ public class PhotonUtility
     {
         Hashtable hash = PhotonNetwork.LocalPlayer.CustomProperties;
 
-        object value;
-
-        hash = PhotonNetwork.LocalPlayer.CustomProperties;
-
-        if (hash.TryGetValue(ContinuousController.PlayerNameKey, out value))
+        if (hash.TryGetValue(ContinuousController.PlayerNameKey, out object value))
         {
             hash[ContinuousController.PlayerNameKey] = ContinuousController.instance.PlayerName;
         }

+ 3 - 3
Assets/Scripts/Script/DataBase.cs

@@ -1,4 +1,4 @@
-using System.Collections;
+using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using System;
@@ -455,7 +455,7 @@ public class DataBase : MonoBehaviour
 
     public static string PierceEffectDiscription()
     {
-        return "<Piercing> (When this Digimon attacks and deletes an opponent's Digimon and survives the battle, it performs any security checks it normally would.)";
+        return "<Piercing> (When this Digimon deletes your opponent's Digimon in battle while attacking, it checks security before the attack ends.)";
     }
 
     public static string RetaliationEffectDiscription()
@@ -1016,4 +1016,4 @@ public class ParameterComparer : IEqualityComparer<object[]>
     }
 
     #endregion
-}
+}

+ 6 - 6
Assets/Scripts/Script/DeckInfoPanel.cs

@@ -5,15 +5,15 @@ using System;
 using UnityEngine.UI;
 using System.Linq;
 using UnityEngine.Events;
-using System.IO;
-using System.Text;
-using System.Runtime.Serialization.Formatters.Binary;
 using System.Threading.Tasks;
 
 
 
+[RequireComponent(typeof(Animator))]
 public class DeckInfoPanel : MonoBehaviour
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     [Header("デッキ情報パネルオブジェクト")]
     public GameObject DeckInfoPanelObject;
 
@@ -49,8 +49,8 @@ public class DeckInfoPanel : MonoBehaviour
         {
             if (GetComponent<Animator>() != null)
             {
-                GetComponent<Animator>().SetInteger("Open", 1);
-                GetComponent<Animator>().SetInteger("Close", 0);
+                GetComponent<Animator>().SafeSetInt(OpenHash, 1);
+                GetComponent<Animator>().SafeSetInt(CloseHash, 0);
             }
 
             ShowingDeckData = deckData;
@@ -242,7 +242,7 @@ public class DeckInfoPanel : MonoBehaviour
 
         while (text.Length > DeckName.characterLimit)
         {
-            text = text.Substring(0, text.Length - 1);
+            text = text[..^1];
         }
 
         ContinuousController.instance.RenameDeck(ShowingDeckData, text);

+ 6 - 7
Assets/Scripts/Script/DeckListPanel.cs

@@ -2,13 +2,12 @@
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
-using UnityEngine.EventSystems;
 using UnityEngine.Events;
-using System;
-using System.Linq;
 
 public class DeckListPanel : MonoBehaviour
 {
+    private static readonly int OpenHash = Animator.StringToHash("Open");
+    private static readonly int CloseHash = Animator.StringToHash("Close");
     public Animator anim;
 
     public CardPrefab_CreateDeck cardPrefab_CreateDeckPrefab;
@@ -107,15 +106,15 @@ public class DeckListPanel : MonoBehaviour
     public void Open()
     {
         On();
-        anim.SetInteger("Open", 1);
-        anim.SetInteger("Close", 0);
+        anim.SafeSetInt(OpenHash, 1);
+        anim.SafeSetInt(CloseHash, 0);
     }
 
     public void Close()
     {
         //OffDetailCard();
-        anim.SetInteger("Open", 0);
-        anim.SetInteger("Close", 1);
+        anim.SafeSetInt(OpenHash, 0);
+        anim.SafeSetInt(CloseHash, 1);
     }
 
     public void On()

+ 36 - 36
Assets/Scripts/Script/DetailCard_DeckEditor.cs

@@ -78,7 +78,7 @@ public class DetailCard_DeckEditor : MonoBehaviour
         //カード名背景
         for (int i = 0; i < cardNameBackgrounds.Count; i++)
         {
-            CardColor cardColor = CardColor.None;
+            CardColor cardColor;
 
             if (i < cEntity_Base.cardColors.Count)
             {
@@ -353,38 +353,38 @@ public class DetailCard_DeckEditor : MonoBehaviour
 
         digimonDetailObject.SetActive(levelText.gameObject.activeSelf || formText.gameObject.activeSelf || attributeText.gameObject.activeSelf  || typeText.gameObject.activeSelf);
 
-        string changeColorString(string s)
-        {
-            List<string> keyWordEffect = new List<string>()
-            {
-                "Blocker",
-                "Security Attack +",
-                "Security Attack -",
-                "Delay",
-                "Draw 1",
-                "Draw 2",
-                "Draw 3",
-                "Armor Purge",
-                "Jamming",
-                "DNA Digivolution",
-                "Save",
-                "Decoy",
-                "Digi-Burst",
-                "Piercing",
-                "Blitz",
-                "Material Save",
-                "Recovery +",
-                "Evade",
-                "Digisorption",
-                "Reboot",
-                "Rush",
-                "De-Digivolve",
-                "Retaliation",
-                "Raid",
-            };
-
-            return s;
-        }
+        //string changeColorString(string s)
+        //{
+        //    List<string> keyWordEffect = new List<string>()
+        //    {
+        //        "Blocker",
+        //        "Security Attack +",
+        //        "Security Attack -",
+        //        "Delay",
+        //        "Draw 1",
+        //        "Draw 2",
+        //        "Draw 3",
+        //        "Armor Purge",
+        //        "Jamming",
+        //        "DNA Digivolution",
+        //        "Save",
+        //        "Decoy",
+        //        "Digi-Burst",
+        //        "Piercing",
+        //        "Blitz",
+        //        "Material Save",
+        //        "Recovery +",
+        //        "Evade",
+        //        "Digisorption",
+        //        "Reboot",
+        //        "Rush",
+        //        "De-Digivolve",
+        //        "Retaliation",
+        //        "Raid",
+        //    };
+        //
+        //    return s;
+        //}
 
         //効果テキスト
         if (ContinuousController.instance.language == Language.ENG)
@@ -408,7 +408,7 @@ public class DetailCard_DeckEditor : MonoBehaviour
             #region Text Colors
             for (int i = 0; i < alternativeEffectTitleBackgrounds.Count; i++)
             {
-                CardColor cardColor = CardColor.None;
+                CardColor cardColor;
 
                 if (i < cEntity_Base.cardColors.Count)
                 {
@@ -421,7 +421,7 @@ public class DetailCard_DeckEditor : MonoBehaviour
                 }
 
                 alternativeEffectTitleBackgrounds[i].color = DataBase.CardColor_ColorDarkDictionary[cardColor];
-                List<CardColor> tempColors = new List<CardColor>();
+                List<CardColor> tempColors;
 
                 if (cEntity_Base.IsDualCard)
                     tempColors = cEntity_Base.OptionCardColorRequirements;
@@ -526,4 +526,4 @@ public class EvoCostColorTab_DetailCard
 
     [Header("メモリーコストテキスト")]
     public TextMeshProUGUI memoryCostText;
-}
+}

+ 0 - 2
Assets/Scripts/Script/DigiXrosEffectObject.cs

@@ -1,8 +1,6 @@
 using System.Collections;
-using System.Collections.Generic;
 using UnityEngine;
 using DG.Tweening;
-using UnityEngine.UI;
 
 public class DigiXrosEffectObject : EvolutionEffectObject
 {

+ 16 - 29
Assets/Scripts/Script/EditDeck.cs

@@ -8,6 +8,7 @@ using UnityEngine.EventSystems;
 using UnityEngine.UI;
 public class EditDeck : MonoBehaviour
 {
+    private static WaitForSeconds _waitForSeconds0_1 = new WaitForSeconds(0.1f);
     [Header("Deck creation object")]
     public GameObject CreateDeckObject;
 
@@ -66,13 +67,6 @@ public class EditDeck : MonoBehaviour
     int _oldKeyCardId = -1;
     bool _isFromClipboard = false;
 
-    private void Start()
-    {
-#if !UNITY_EDITOR && UNITY_ANDROID
-        CardPoolScroll.content.GetComponent<GridLayoutGroup>().constraintCount = 5;
-#endif
-    }
-
     void CheckButtonEnabled()
     {
         UpDisplayPageIndexButton.interactable = DisplayPageIndex < _maxDisplayPageIndex;
@@ -285,9 +279,8 @@ public class EditDeck : MonoBehaviour
 
         for (int i = 0; i < Opening.instance.deck.selectDeck.deckInfoPrefabParentScroll.content.childCount; i++)
         {
-            CreateNewDeckButton createNewDeckButton = Opening.instance.deck.selectDeck.deckInfoPrefabParentScroll.content.GetChild(i).GetComponent<CreateNewDeckButton>();
-
-            if (createNewDeckButton != null)
+            
+            if (Opening.instance.deck.selectDeck.deckInfoPrefabParentScroll.content.GetChild(i).TryGetComponent<CreateNewDeckButton>(out var createNewDeckButton))
             {
                 createNewDeckButton.CreateNewDeckWayObject.Close_(false);
                 break;
@@ -314,7 +307,7 @@ public class EditDeck : MonoBehaviour
         }
         else
         {
-            ContinuousController.instance.SaveDeckDatas();
+            //ContinuousController.instance.SaveDeckDatas();
             ContinuousController.instance.SaveDeckData(EdittingDeckData);
         }
             #endregion
@@ -347,7 +340,7 @@ public class EditDeck : MonoBehaviour
 
         yield return new WaitUntil(() => DeckScroll.content.childCount == 0);
 
-        yield return new WaitForSeconds(0.1f);
+        yield return _waitForSeconds0_1;
 
         CreateDeckObject.SetActive(false);
 
@@ -383,7 +376,7 @@ public class EditDeck : MonoBehaviour
 
         else
         {
-            Opening.instance.battle.selectBattleDeck.ResetDeckInfoPanel();
+            yield return Opening.instance.battle.selectBattleDeck.ResetDeckInfoPanel();
 
             yield return ContinuousController.instance.StartCoroutine(Opening.instance.battle.selectBattleDeck.SetDeckList(false));
 
@@ -455,7 +448,7 @@ public class EditDeck : MonoBehaviour
     {
         yield return ContinuousController.instance.StartCoroutine(LoadingObjec.StartLoading("Now Loading"));
 
-        yield return new WaitForSeconds(0.1f);
+        yield return _waitForSeconds0_1;
 
         for (int i = 0; i < draggable_CardParent.childCount; i++)
         {
@@ -472,7 +465,7 @@ public class EditDeck : MonoBehaviour
 
         EdittingDeckData = deckData;
 
-        ContinuousController.instance.SaveDeckDatas();
+        //ContinuousController.instance.SaveDeckDatas();
         //ContinuousController.instance.SaveDeckData(EdittingDeckData);
 
         OffDetailCard();
@@ -540,7 +533,7 @@ public class EditDeck : MonoBehaviour
 
         cardDistribution.SetCardDistribution(EdittingDeckData);
 
-        yield return new WaitForSeconds(0.1f);
+        yield return _waitForSeconds0_1;
 
         for (int i = 0; i < DeckScroll.content.childCount; i++)
         {
@@ -572,10 +565,8 @@ public class EditDeck : MonoBehaviour
         cardDistribution.Init();
 
         for (int i = 0; i < CardPoolScroll.content.childCount; i++)
-        {
-            CardPrefab_CreateDeck cardPrefab_CreateDeck = CardPoolScroll.content.GetChild(i).GetComponent<CardPrefab_CreateDeck>();
-
-            if (cardPrefab_CreateDeck != null)
+        {            
+            if (CardPoolScroll.content.GetChild(i).TryGetComponent<CardPrefab_CreateDeck>(out var cardPrefab_CreateDeck))
             {
                 CardPoolCardPrefabs_CreateDeck.Add(cardPrefab_CreateDeck);
             }
@@ -627,7 +618,7 @@ public class EditDeck : MonoBehaviour
 
         yield return ContinuousController.instance.StartCoroutine(SetSprittedCardLists());
 
-        yield return new WaitForSeconds(0.1f);
+        yield return _waitForSeconds0_1;
 
         DoneSetUp = true;
     }
@@ -1056,10 +1047,8 @@ public class EditDeck : MonoBehaviour
         List<CardPrefab_CreateDeck> cardPrefabs = new List<CardPrefab_CreateDeck>();
 
         for (int i = 0; i < DeckScroll.content.childCount; i++)
-        {
-            CardPrefab_CreateDeck cardPrefab = DeckScroll.content.GetChild(i).GetComponent<CardPrefab_CreateDeck>();
-
-            if (cardPrefab != null)
+        {        
+            if (DeckScroll.content.GetChild(i).TryGetComponent<CardPrefab_CreateDeck>(out var cardPrefab))
             {
                 cardPrefabs.Add(cardPrefab);
 
@@ -1239,10 +1228,8 @@ public class EditDeck : MonoBehaviour
         List<CardPrefab_CreateDeck> cardPrefabs = new List<CardPrefab_CreateDeck>();
 
         for (int i = 0; i < DeckScroll.content.childCount; i++)
-        {
-            CardPrefab_CreateDeck cardPrefab = DeckScroll.content.GetChild(i).GetComponent<CardPrefab_CreateDeck>();
-
-            if (cardPrefab != null)
+        {         
+            if (DeckScroll.content.GetChild(i).TryGetComponent<CardPrefab_CreateDeck>(out var cardPrefab))
             {
                 cardPrefabs.Add(cardPrefab);
             }

+ 47 - 41
Assets/Scripts/Script/Effects.cs

@@ -10,6 +10,20 @@ using TMPro;
 using Cinemachine;
 public class Effects : MonoBehaviour
 {
+    private static WaitForSeconds _waitForSeconds0_05 = new WaitForSeconds(0.05f);
+    private static WaitForSeconds _waitForSeconds0_4 = new WaitForSeconds(0.4f);
+    private static WaitForSeconds _waitForSeconds0_3 = new WaitForSeconds(0.3f);
+    private static WaitForSeconds _waitForSeconds0_17 = new WaitForSeconds(0.17f);
+    private static WaitForSeconds _waitForSeconds0_06 = new WaitForSeconds(0.06f);
+    private static WaitForSeconds _waitForSeconds0_04 = new WaitForSeconds(0.04f);
+    private static WaitForSeconds _waitForSeconds0_1 = new WaitForSeconds(0.1f);
+    private static WaitForSeconds _waitForSeconds0_12 = new WaitForSeconds(0.12f);
+    private static WaitForSeconds _waitForSeconds0_16 = new WaitForSeconds(0.16f);
+    private static WaitForSeconds _waitForSeconds0_48 = new WaitForSeconds(0.48f);
+    private static WaitForSeconds _waitForSeconds2_5 = new WaitForSeconds(2.5f);
+    private static WaitForSeconds _waitForSeconds0_25 = new WaitForSeconds(0.25f);
+    private static WaitForSeconds _waitForSeconds5 = new WaitForSeconds(5f);
+    private static WaitForSeconds _waitForSeconds0_07 = new WaitForSeconds(0.07f);
     [SerializeField] Transform effectParent;
     public void Init()
     {
@@ -151,7 +165,7 @@ public class Effects : MonoBehaviour
 
         end = false;
 
-        yield return new WaitForSeconds(0.07f);
+        yield return _waitForSeconds0_07;
 
         //card.Owner.HandCards.Remove(card);
 
@@ -176,7 +190,7 @@ public class Effects : MonoBehaviour
     #region エフェクトを削除する
     public static IEnumerator DeleteCoroutine(GameObject effect, FieldPermanentCard fieldPermanentCard)
     {
-        yield return new WaitForSeconds(5f);
+        yield return _waitForSeconds5;
 
         Destroy(effect);
 
@@ -205,7 +219,7 @@ public class Effects : MonoBehaviour
 
             permanent.ShowingPermanentCard.OnUsingSkillEffect();
 
-            yield return new WaitForSeconds(0.48f);
+            yield return _waitForSeconds0_48;
         }
     }
     #endregion
@@ -274,7 +288,7 @@ public class Effects : MonoBehaviour
             yield return new WaitWhile(() => !end);
             end = false;
 
-            yield return new WaitForSeconds(0.25f);
+            yield return _waitForSeconds0_25;
 
             sequence = DOTween.Sequence();
 
@@ -358,7 +372,7 @@ public class Effects : MonoBehaviour
                 yield return new WaitWhile(() => !end);
                 end = false;
 
-                yield return new WaitForSeconds(0.16f);
+                yield return _waitForSeconds0_16;
 
                 sequence = DOTween.Sequence();
 
@@ -429,7 +443,7 @@ public class Effects : MonoBehaviour
                 end = false;
 
                 cardSource.ShowingHandCard.GetComponent<RectTransform>().pivot = new Vector2(0.5f, targetPivotY);
-                yield return new WaitForSeconds(0.25f);
+                yield return _waitForSeconds0_25;
 
                 if (cardSource.Owner.HandTransform.GetComponent<HandContoller>() != null)
                 {
@@ -591,7 +605,7 @@ public class Effects : MonoBehaviour
             end = false;
         }
 
-        yield return new WaitForSeconds(0.1f);
+        yield return _waitForSeconds0_1;
     }
     #endregion
 
@@ -720,7 +734,7 @@ public class Effects : MonoBehaviour
                 end = false;
             }
 
-            yield return new WaitForSeconds(0.12f);
+            yield return _waitForSeconds0_12;
 
             targetFieldPermanentCard.ShowPermanentData(true);
             targetFieldPermanentCard.Parent.SetActive(true);
@@ -802,7 +816,7 @@ public class Effects : MonoBehaviour
 
                     Destroy(fieldPermanentCard.gameObject);
 
-                    yield return new WaitForSeconds(0.1f);
+                    yield return _waitForSeconds0_1;
                 }
             }
         }
@@ -996,7 +1010,7 @@ public class Effects : MonoBehaviour
 
     public IEnumerator HideShowCard()
     {
-        yield return new WaitForSeconds(2.5f);
+        yield return _waitForSeconds2_5;
 
         float timer = 0f;
 
@@ -1120,7 +1134,7 @@ public class Effects : MonoBehaviour
 
     public IEnumerator HideShowCard2()
     {
-        yield return new WaitForSeconds(2.5f);
+        yield return _waitForSeconds2_5;
 
         float timer = 0f;
 
@@ -1250,15 +1264,15 @@ public class Effects : MonoBehaviour
             StartCoroutine(DeleteCoroutine(effect2, null));
             #endregion
 
-            yield return new WaitForSeconds(0.04f);
+            yield return _waitForSeconds0_04;
         }
 
-        yield return new WaitForSeconds(0.05f);
+        yield return _waitForSeconds0_05;
 
         //縮小して上に上がる
         StartCoroutine(ShrinkUpUseHandCard(ShowUseHandCard));
 
-        yield return new WaitForSeconds(0.06f);
+        yield return _waitForSeconds0_06;
 
     }
     #endregion
@@ -1349,7 +1363,7 @@ public class Effects : MonoBehaviour
 
         GameObject effect2 = Instantiate(ShowUseHandCardEffectPrefab, ShowUseHandCardParent);
         effect2.transform.SetSiblingIndex(0);
-        effect2.transform.localRotation = Quaternion.EulerAngles(new Vector3(0, 90, 0));
+        effect2.transform.localRotation = Quaternion.Euler(new Vector3(0, 90, 0));
         StartCoroutine(DeleteCoroutine(effect2, null));
         #endregion
 
@@ -1419,7 +1433,7 @@ public class Effects : MonoBehaviour
         end = false;
         #endregion
 
-        yield return new WaitForSeconds(0.16f);
+        yield return _waitForSeconds0_16;
     }
     #endregion
 
@@ -1457,7 +1471,7 @@ public class Effects : MonoBehaviour
 
                     ContinuousController.instance.PlaySE(BuffSE);
 
-                    yield return new WaitForSeconds(0.1f);
+                    yield return _waitForSeconds0_1;
                 }
             }
         }
@@ -1500,12 +1514,12 @@ public class Effects : MonoBehaviour
 
                     if (permanent.DP <= 0)
                     {
-                        yield return new WaitForSeconds(0.4f);
+                        yield return _waitForSeconds0_4;
                     }
 
                     else
                     {
-                        yield return new WaitForSeconds(0.1f);
+                        yield return _waitForSeconds0_1;
                     }
                 }
             }
@@ -1548,7 +1562,7 @@ public class Effects : MonoBehaviour
             ContinuousController.instance.PlaySE(DigiXrosSelectCardEffectSE);
         }
 
-        yield return new WaitForSeconds(0.3f);
+        yield return _waitForSeconds0_3;
     }
     #endregion
 
@@ -1587,7 +1601,7 @@ public class Effects : MonoBehaviour
             ContinuousController.instance.PlaySE(AssemblySelectCardEffectSE);
         }
 
-        yield return new WaitForSeconds(0.3f);
+        yield return _waitForSeconds0_3;
     }
     #endregion
 
@@ -1654,7 +1668,7 @@ public class Effects : MonoBehaviour
     {
         ContinuousController.instance.StartCoroutine(player.securityObject.securityBreakGlass.BreakIenumerator());
 
-        yield return new WaitForSeconds(0.06f);
+        yield return _waitForSeconds0_06;
 
         GameObject effect2 = Instantiate(BlueEvolutionEffect, effectParent);
         effect2.transform.position = new Vector3(player.securityObject.securityBreakGlass.transform.position.x, player.securityObject.securityBreakGlass.transform.position.y, player.securityObject.securityBreakGlass.transform.position.z);
@@ -1672,7 +1686,7 @@ public class Effects : MonoBehaviour
         effect2.transform.localScale = new Vector3(5, 1, 5);
         StartCoroutine(DeleteCoroutine(effect2, null));
 
-        yield return new WaitForSeconds(0.17f);
+        yield return _waitForSeconds0_17;
     }
     #endregion
 
@@ -1703,11 +1717,10 @@ public class Effects : MonoBehaviour
         BreakGlass permanetBreakGlass = Instantiate(permanetBreakGlassPrefab, fieldPermanentCard.transform.parent);
 
         //場所を指定
-        permanetBreakGlass.transform.localPosition = fieldPermanentCard.transform.localPosition;
-        permanetBreakGlass.transform.localRotation = Quaternion.Euler(
+        permanetBreakGlass.transform.SetLocalPositionAndRotation(fieldPermanentCard.transform.localPosition, Quaternion.Euler(
             fieldPermanentCard.transform.localRotation.eulerAngles.x + 180,
             fieldPermanentCard.transform.localRotation.eulerAngles.y,
-            fieldPermanentCard.transform.localRotation.eulerAngles.z * -1);
+            fieldPermanentCard.transform.localRotation.eulerAngles.z * -1));
         permanetBreakGlass.transform.localScale = new Vector3(54, 54, 1);
 
         //ガラスを初期化
@@ -1781,10 +1794,6 @@ public class Effects : MonoBehaviour
     {
         ContinuousController.instance.PlaySE(GManager.instance.ShowPlayCardSE);
 
-        bool end = false;
-
-        var sequence = DOTween.Sequence();
-
         #region 白いカードが回転
         ShowUseHandCard.gameObject.SetActive(true);
         ShowUseHandCard.Outline_Select.SetActive(false);
@@ -1809,10 +1818,8 @@ public class Effects : MonoBehaviour
         ShowUseHandCard.ShowDP();
 
         float animTime = 0.2f;
-
-        Animator animator = ShowUseHandCard.gameObject.GetComponent<Animator>();
-
-        if (animator == null)
+   
+        if (!ShowUseHandCard.gameObject.TryGetComponent<Animator>(out var animator))
         {
             animator = ShowUseHandCard.gameObject.AddComponent<Animator>();
         }
@@ -1848,13 +1855,13 @@ public class Effects : MonoBehaviour
 
         GameObject effect2 = Instantiate(ShowUseHandCardEffectPrefab, ShowUseHandCardParent);
         effect2.transform.SetSiblingIndex(0);
-        effect2.transform.localRotation = Quaternion.EulerAngles(new Vector3(0, 90, 0));
+        effect2.transform.localRotation = Quaternion.Euler(new Vector3(0, 90, 0));
         StartCoroutine(DeleteCoroutine(effect2, null));
         #endregion
 
         #endregion
 
-        yield return new WaitForSeconds(0.17f);
+        yield return _waitForSeconds0_17;
     }
     #endregion
 
@@ -1954,8 +1961,7 @@ public class Effects : MonoBehaviour
         BreakGlass permanetBreakGlass = Instantiate(permanetBreakGlassPrefab, ShowUseHandCard.transform.parent);
 
         //場所を指定
-        permanetBreakGlass.transform.localPosition = ShowUseHandCard.transform.localPosition;
-        permanetBreakGlass.transform.localRotation = Quaternion.Euler(ShowUseHandCard.transform.localRotation.eulerAngles.x + 180, ShowUseHandCard.transform.localRotation.eulerAngles.y, ShowUseHandCard.transform.localRotation.eulerAngles.z * -1);
+        permanetBreakGlass.transform.SetLocalPositionAndRotation(ShowUseHandCard.transform.localPosition, Quaternion.Euler(ShowUseHandCard.transform.localRotation.eulerAngles.x + 180, ShowUseHandCard.transform.localRotation.eulerAngles.y, ShowUseHandCard.transform.localRotation.eulerAngles.z * -1));
         permanetBreakGlass.transform.localScale = new Vector3(30.1f, 30.1f, 1);
 
         //ガラスを初期化
@@ -2146,7 +2152,7 @@ public class Effects : MonoBehaviour
                 sequence.Kill();
             }
 
-            yield return new WaitForSeconds(0.1f);
+            yield return _waitForSeconds0_1;
 
             for (int i = 0; i < BattleAnimationObjects.Count; i++)
             {
@@ -2237,7 +2243,7 @@ public class Effects : MonoBehaviour
 
                     end = false;
 
-                    yield return new WaitForSeconds(0.17f);
+                    yield return _waitForSeconds0_17;
 
                     ShowUseHandCard.Outline_Select.SetActive(false);
 
@@ -2299,7 +2305,7 @@ public class Effects : MonoBehaviour
 
                 sequence.Kill();
 
-                yield return new WaitForSeconds(0.1f);
+                yield return _waitForSeconds0_1;
             }
         }
     }

+ 16 - 19
Assets/Scripts/Script/EnterRoom.cs

@@ -3,14 +3,11 @@ using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 using Photon.Pun;
-using Photon.Realtime;
-using UnityEngine.SceneManagement;
-using System;
-using System.Linq;
-using Hashtable = ExitGames.Client.Photon.Hashtable;
 using UnityEngine.Events;
 public class EnterRoom : MonoBehaviourPunCallbacks
 {
+    private static readonly int OpenHash = Animator.StringToHash("Open");
+    private static readonly int CloseHash = Animator.StringToHash("Close");
     [Header("Room ID InputField")]
     public InputField RoomIDInputField;
 
@@ -23,11 +20,11 @@ public class EnterRoom : MonoBehaviourPunCallbacks
     [Header("Enter Room Button")]
     public Button EnterRoomButton;
 
-    Image EnterRoomButtonImage;
+    Image _enterRoomButtonImage;
 
     private void Start()
     {
-        EnterRoomButtonImage = EnterRoomButton.GetComponent<Image>();
+        _enterRoomButtonImage = EnterRoomButton.GetComponent<Image>();
     }
 
 
@@ -42,8 +39,8 @@ public class EnterRoom : MonoBehaviourPunCallbacks
 
         this.gameObject.SetActive(true);
 
-        anim.SetInteger("Open", 1);
-        anim.SetInteger("Close", 0);
+        anim.SafeSetInt(OpenHash, 1);
+        anim.SafeSetInt(CloseHash, 0);
     }
 
     public void Close_(bool playSE)
@@ -53,8 +50,8 @@ public class EnterRoom : MonoBehaviourPunCallbacks
             Opening.instance.PlayCancelSE();
         }
 
-        anim.SetInteger("Open", 0);
-        anim.SetInteger("Close", 1);
+        anim.SafeSetInt(OpenHash, 0);
+        anim.SafeSetInt(CloseHash, 1);
     }
 
     public void Off()
@@ -62,11 +59,11 @@ public class EnterRoom : MonoBehaviourPunCallbacks
         this.gameObject.SetActive(false);
     }
 
-    bool canClick = true;
+    bool _canClick = true;
 
     public void OnClickEnterRoomButton()
     {
-        if (CanClickEnterRoomButton() && canClick)
+        if (CanClickEnterRoomButton() && _canClick)
         {
             ContinuousController.instance.StartCoroutine(JoinRoomCoroutine());
         }
@@ -74,7 +71,7 @@ public class EnterRoom : MonoBehaviourPunCallbacks
 
     IEnumerator JoinRoomCoroutine()
     {
-        canClick = false;
+        _canClick = false;
 
         if (!PhotonNetwork.IsConnectedAndReady)
         {
@@ -92,7 +89,7 @@ public class EnterRoom : MonoBehaviourPunCallbacks
 
         PhotonNetwork.JoinRoom(RoomIDInputField.text + "-" + ContinuousController.instance.useBanlist);
 
-        canClick = true;
+        _canClick = true;
     }
 
     public override void OnJoinedRoom()
@@ -136,9 +133,9 @@ public class EnterRoom : MonoBehaviourPunCallbacks
         {
             EnterRoomButton.enabled = true;
 
-            if (EnterRoomButtonImage != null)
+            if (_enterRoomButtonImage != null)
             {
-                EnterRoomButtonImage.color = Color.white;
+                _enterRoomButtonImage.color = Color.white;
             }
         }
 
@@ -146,9 +143,9 @@ public class EnterRoom : MonoBehaviourPunCallbacks
         {
             EnterRoomButton.enabled = false;
 
-            if (EnterRoomButtonImage != null)
+            if (_enterRoomButtonImage != null)
             {
-                EnterRoomButtonImage.color = new Color32(144, 144, 144, 255);
+                _enterRoomButtonImage.color = new Color32(144, 144, 144, 255);
             }
         }
     }

+ 2 - 0
Assets/Scripts/Script/EvolutionEffectObject.cs

@@ -27,6 +27,8 @@ public class EvolutionEffectObject : MonoBehaviour
         {
             if (!ContinuousController.instance.showCutInAnimation)
             {
+                yield return new WaitForSeconds(animTime);
+
                 yield break;
             }
         }

+ 4 - 2
Assets/Scripts/Script/GManager.cs

@@ -6,8 +6,10 @@ using System.Linq;
 using UnityEngine;
 using UnityEngine.UI;
 
+[RequireComponent(typeof(Effects))]
 public class GManager : MonoBehaviourPun
 {
+    private static WaitForSeconds _waitForSeconds5 = new WaitForSeconds(5f);
     [Header("あなた")]
     public Player You;
 
@@ -226,7 +228,7 @@ public class GManager : MonoBehaviourPun
     
     #endregion
 
-    private async void Awake()
+    private /*async*/ void Awake()
     {
         //return;
 
@@ -342,7 +344,7 @@ public class GManager : MonoBehaviourPun
 
         yield return new WaitWhile(() => turnStateMachine == null);
 
-        yield return new WaitForSeconds(5f);
+        yield return _waitForSeconds5;
 
         while (true)
         {

+ 11 - 13
Assets/Scripts/Script/GameplayOption.cs

@@ -1,12 +1,10 @@
 using Photon.Pun;
-using System;
-using System.Collections;
-using System.Collections.Generic;
 using UnityEngine;
-using UnityEngine.Events;
 using UnityEngine.UI;
 public class GameplayOption : OffAnimation
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     [SerializeField] Animator _anim;
     [SerializeField] Toggle _reverseOpponentsCardsToggle;
     [SerializeField] Toggle _showCutInAnimationToggle;
@@ -41,8 +39,8 @@ public class GameplayOption : OffAnimation
             }
         }
 
-        _anim.SetInteger("Open", 0);
-        _anim.SetInteger("Close", 1);
+        _anim.SafeSetInt(OpenHash, 0);
+        _anim.SafeSetInt(CloseHash, 1);
     }
 
     public void Init()
@@ -60,11 +58,11 @@ public class GameplayOption : OffAnimation
                 value: ContinuousController.instance.reverseOpponentsCards
             );
 
-            /*OptionUtility.InitToggle(
-                toggle: _showCutInAnimationToggle,
-                onToggleChanged: OnShowCutInAnimationToggleChanged,
-                value: ContinuousController.instance.showCutInAnimation
-            );*/
+            //OptionUtility.InitToggle(
+            //    toggle: _showCutInAnimationToggle,
+            //    onToggleChanged: OnShowCutInAnimationToggleChanged,
+            //    value: ContinuousController.instance.showCutInAnimation
+            //);
 
             OptionUtility.InitToggle(
                 toggle: _turnSuspendedCardsToggle,
@@ -131,8 +129,8 @@ public class GameplayOption : OffAnimation
         }
 
         gameObject.SetActive(true);
-        _anim.SetInteger("Open", 1);
-        _anim.SetInteger("Close", 0);
+        _anim.SafeSetInt(OpenHash, 1);
+        _anim.SafeSetInt(CloseHash, 0);
     }
 
     #region Show cut in animation

+ 6 - 7
Assets/Scripts/Script/GraphicsOptionPanel.cs

@@ -1,12 +1,11 @@
-using System.Collections;
-using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
-using UnityEngine.Events;
 
 
 public class GraphicsOptionPanel : OffAnimation
 {
+    private static readonly int OpenHash = Animator.StringToHash("Open");
+    private static readonly int CloseHash = Animator.StringToHash("Close");
     [SerializeField] Animator _anim;
     [SerializeField] Toggle _showBackgroundParticleToggle;
 
@@ -30,8 +29,8 @@ public class GraphicsOptionPanel : OffAnimation
             }
         }
 
-        _anim.SetInteger("Open", 0);
-        _anim.SetInteger("Close", 1);
+        _anim.SafeSetInt(OpenHash, 0);
+        _anim.SafeSetInt(CloseHash, 1);
     }
 
     public void Init()
@@ -51,8 +50,8 @@ public class GraphicsOptionPanel : OffAnimation
         }
 
         gameObject.SetActive(true);
-        _anim.SetInteger("Open", 1);
-        _anim.SetInteger("Close", 0);
+        _anim.SafeSetInt(OpenHash, 1);
+        _anim.SafeSetInt(CloseHash, 0);
     }
 
     #region Auto select mode

+ 0 - 2
Assets/Scripts/Script/HideCannotSelectObject.cs

@@ -1,4 +1,3 @@
-using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
@@ -6,7 +5,6 @@ using UnityEngine.UI;
 public class HideCannotSelectObject : MonoBehaviour
 {
     [SerializeField] Transform _cardUnmasksParent;
-    bool _first = false;
 
     List<PermanentUnMask> _permanentUnMasks = new List<PermanentUnMask>();
     public void Init()

+ 2 - 4
Assets/Scripts/Script/HomeMode.cs

@@ -62,10 +62,8 @@ public class HomeMode : MonoBehaviour
         Opening.instance.deck.deckListPanel.Close();
 
         for (int i = 0; i < Opening.instance.deck.selectDeck.deckInfoPrefabParentScroll.content.childCount; i++)
-        {
-            CreateNewDeckButton createNewDeckButton = Opening.instance.deck.selectDeck.deckInfoPrefabParentScroll.content.GetChild(i).GetComponent<CreateNewDeckButton>();
-
-            if (createNewDeckButton != null)
+        {    
+            if (Opening.instance.deck.selectDeck.deckInfoPrefabParentScroll.content.GetChild(i).TryGetComponent<CreateNewDeckButton>(out var createNewDeckButton))
             {
                 createNewDeckButton.CreateNewDeckWayObject.Off();
                 break;

+ 1 - 1
Assets/Scripts/Script/ICardEffect.cs

@@ -387,7 +387,7 @@ public abstract class ICardEffect
         {
             if (EffectSourceCard != null)
             {
-                if (EffectSourceCard.PermanentOfThisCard() != null)
+                if (EffectSourceCard.PermanentOfThisCard() != null && !IsOnDeletion)
                 {
                     if (IsInheritedEffect || IsLinkedEffect)
                     {

+ 7 - 5
Assets/Scripts/Script/LanguagePanel.cs

@@ -6,6 +6,8 @@ using UnityEngine.Events;
 
 public class LanguagePanel : OffAnimation
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     [SerializeField] Animator _anim;
     [SerializeField] List<LanguageToggle> _languageToggles = new();
 
@@ -29,8 +31,8 @@ public class LanguagePanel : OffAnimation
             }
         }
 
-        _anim.SetInteger("Open", 0);
-        _anim.SetInteger("Close", 1);
+        _anim.SafeSetInt(OpenHash, 0);
+        _anim.SafeSetInt(CloseHash, 1);
     }
 
     public void Init()
@@ -44,7 +46,7 @@ public class LanguagePanel : OffAnimation
         {
             foreach (LanguageToggle languageToggle in _languageToggles)
             {
-                void OnToggleChange(Language language)
+                static void OnToggleChange(Language language)
                 {
                     ContinuousController.instance.language = language;
                     ContinuousController.instance.SaveLanguage();
@@ -57,7 +59,7 @@ public class LanguagePanel : OffAnimation
         }
 
         gameObject.SetActive(true);
-        _anim.SetInteger("Open", 1);
-        _anim.SetInteger("Close", 0);
+        _anim.SafeSetInt(OpenHash, 1);
+        _anim.SafeSetInt(CloseHash, 0);
     }
 }

+ 23 - 21
Assets/Scripts/Script/LobbyManager_RandomMatch.cs

@@ -8,6 +8,8 @@ using UnityEngine.SceneManagement;
 using System;
 public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     private static WaitForSeconds _waitForSeconds0_2 = new WaitForSeconds(0.2f);
     private static WaitForSeconds _waitForSeconds0_1 = new WaitForSeconds(0.1f);
     private static WaitForSeconds _waitForSeconds0_5 = new WaitForSeconds(0.5f);
@@ -63,8 +65,8 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
         //this.battleRule = battleRule;
         ContinuousController.instance.StartCoroutine(ConnectCoroutine());
 
-        anim.SetInteger("Open", 1);
-        anim.SetInteger("Close", 0);
+        anim.SetInteger(OpenHash, 1);
+        anim.SetInteger(CloseHash, 0);
     }
     #endregion
 
@@ -125,8 +127,6 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
         MessageText.text = "";
         TimeText.gameObject.SetActive(true);
         StartCoroutine(TimeCountUp());
-        timer = 0;
-        count = true;
 
         if (PhotonNetwork.InLobby)
         {
@@ -185,7 +185,9 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
 
         if (ContinuousController.instance.BattleDeckData != null)
         {
-            deckInfoPanel.SetUpDeckInfoPanel(ContinuousController.instance.BattleDeckData);
+            _ = deckInfoPanel.SetUpDeckInfoPanel(
+                ContinuousController.instance.BattleDeckData
+            );
         }
 
         if (ReturnButton != null)
@@ -337,24 +339,26 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
         yield return new WaitWhile(() => !PhotonNetwork.InLobby);
 
         //Setting up the room to be created
-        RoomOptions roomOptions = new RoomOptions();
-        roomOptions.IsVisible = true;   //Make the room visible in the lobby.
-        roomOptions.IsOpen = true;      //Allow other players to enter the room
-        roomOptions.PublishUserId = true;
+        RoomOptions roomOptions = new RoomOptions
+        {
+            IsVisible = true,   //Make the room visible in the lobby.
+            IsOpen = true,      //Allow other players to enter the room
+            PublishUserId = true,
 
-        roomOptions.MaxPlayers = 2;
+            MaxPlayers = 2,
 
-        //To display room creator in room custom properties, store creator's name
-        roomOptions.CustomRoomProperties = new ExitGames.Client.Photon.Hashtable()
-        {
-            { "RoomCreator",PhotonNetwork.NickName },
+            //To display room creator in room custom properties, store creator's name
+            CustomRoomProperties = new ExitGames.Client.Photon.Hashtable()
+            {
+                { "RoomCreator",PhotonNetwork.NickName },
 
-        };
+            },
 
-        //Display custom property information in the lobby
-        roomOptions.CustomRoomPropertiesForLobby = new string[]
-        {
-            "RoomCreator",
+            //Display custom property information in the lobby
+            CustomRoomPropertiesForLobby = new string[]
+            {
+                "RoomCreator",
+            }
         };
 
         string RoomName = StringUtils.GeneratePassword_AlpahabetNum(8);
@@ -465,8 +469,6 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
         endLoadingText = true;
     }
 
-    bool count = true;
-    float timer = 0;
     Button ReturnButtonButton;
     private void Start()
     {

+ 14 - 12
Assets/Scripts/Script/Opening.cs

@@ -8,8 +8,12 @@ using UnityEngine.UI;
 using UnityEngine.Events;
 using System;
 using System.Threading.Tasks;
+
+[RequireComponent(typeof(OpenURL))]
 public class Opening : MonoBehaviour
 {
+    private static WaitForSeconds _waitForSeconds0_15 = new WaitForSeconds(0.15f);
+    private static WaitForSeconds _waitForSeconds0_1 = new WaitForSeconds(0.1f);
     [Header("読み込み中表示オブジェクト")]
     public LoadingObject LoadingObject;
 
@@ -180,9 +184,11 @@ public class Opening : MonoBehaviour
         //bool isRay = false;
 
         List<RaycastResult> results = new List<RaycastResult>();
-        PointerEventData pointer = new PointerEventData(EventSystem.current);
-        // マウスポインタの位置にレイ飛ばし、ヒットしたものを保存
-        pointer.position = Input.mousePosition;
+        PointerEventData pointer = new PointerEventData(EventSystem.current)
+        {
+            // マウスポインタの位置にレイ飛ばし、ヒットしたものを保存
+            position = Input.mousePosition
+        };
         EventSystem.current.RaycastAll(pointer, results);
 
         // ヒットしたUIの名前
@@ -361,10 +367,8 @@ public class Opening : MonoBehaviour
             List<Camera> openingCameras = new List<Camera>();
 
             for (int i = 0; i < camerasParent.childCount; i++)
-            {
-                Camera camera = camerasParent.GetChild(i).GetComponent<Camera>();
-
-                if (camera != null)
+            {             
+                if (camerasParent.GetChild(i).TryGetComponent<Camera>(out var camera))
                 {
                     openingCameras.Add(camera);
                 }
@@ -405,9 +409,7 @@ public class Opening : MonoBehaviour
         mousePos.y = mousePos.y * magnification - canvasRect.sizeDelta.y / 2;
         mousePos.z = 0;// -0.5f;// transform.localPosition.z;
 
-        effect.transform.localPosition = mousePos;
-
-        effect.transform.localRotation = Quaternion.EulerAngles(new Vector3(77, 0, 0));
+        effect.transform.SetLocalPositionAndRotation(mousePos, Quaternion.Euler(new Vector3(77, 0, 0)));
 
         StartCoroutine(Effects.DeleteCoroutine(effect, null));
     }
@@ -477,7 +479,7 @@ public class Opening : MonoBehaviour
             }
         }
 
-        yield return new WaitForSeconds(0.1f);
+        yield return _waitForSeconds0_1;
 
         VerText.text = $"Ver{ContinuousController.instance.GameVerString}";
 
@@ -488,7 +490,7 @@ public class Opening : MonoBehaviour
 
         LoadCardImages();
 
-        yield return new WaitForSeconds(0.15f);
+        yield return _waitForSeconds0_15;
 
         yield return StartCoroutine(LoadingObject.EndLoading());
     }

+ 5 - 3
Assets/Scripts/Script/OptionPanel.cs

@@ -6,6 +6,8 @@ using UnityEngine.Events;
 
 public class OptionPanel : OffAnimation
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     [SerializeField] VolumePanel _volumePanel;
     [SerializeField] ResizeWindow _resizeWindowPanel;
     [SerializeField] GameplayOption _gameplayOption;
@@ -187,8 +189,8 @@ public class OptionPanel : OffAnimation
             }
         }
 
-        _anim.SetInteger("Open", 0);
-        _anim.SetInteger("Close", 1);
+        _anim.SafeSetInt(OpenHash, 0);
+        _anim.SafeSetInt(CloseHash, 1);
     }
 
     public void Init()
@@ -232,6 +234,6 @@ public class OptionPanel : OffAnimation
         return;
 #endif
 
-        Application.Quit();
+        //Application.Quit();
     }
 }

+ 0 - 3
Assets/Scripts/Script/OptionUtility.cs

@@ -1,6 +1,3 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
 using UnityEngine.UI;
 using UnityEngine.Events;
 public static class OptionUtility

+ 0 - 7
Assets/Scripts/Script/PatchNotes.cs

@@ -1,10 +1,6 @@
 using System.Collections;
-using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
-using UnityEngine.Events;
-using System.Threading.Tasks;
-using System;
 public class PatchNotes : OffAnimation
 {
     [SerializeField] Animator _anim;
@@ -13,7 +9,6 @@ public class PatchNotes : OffAnimation
     [SerializeField][TextArea] string _text_ENG;
     [SerializeField][TextArea] string _text_JPN;
     [SerializeField] ScrollRect _scroll;
-    bool _isOpen = false;
 
     public void ReportBug()
     {
@@ -28,7 +23,6 @@ public class PatchNotes : OffAnimation
     public IEnumerator Open()
     {
         _verText.text = $"Patch Notes ver{ContinuousController.instance.GameVerString}";
-        _isOpen = true;
         gameObject.SetActive(true);
         _anim.SetInteger("Open", 1);
         _anim.SetInteger("Close", 0);
@@ -48,7 +42,6 @@ public class PatchNotes : OffAnimation
 
     public void ClosePatchNotesPanel()
     {
-        _isOpen = false;
         bool playSE = false;
 
         if (gameObject.activeSelf)

+ 17 - 15
Assets/Scripts/Script/Player.cs

@@ -24,11 +24,13 @@ public class Player : MonoBehaviour
             {
                 if (BattleAreaFrameParent.GetChild(i).childCount >= 2)
                 {
-                    FieldCardFrame fieldCardFrame = new FieldCardFrame();
-                    fieldCardFrame.Frame = BattleAreaFrameParent.GetChild(i).GetChild(0).gameObject;
-                    fieldCardFrame.Frame_Select = BattleAreaFrameParent.GetChild(i).GetChild(1).GetComponent<Image>();
-                    fieldCardFrame.FrameID = count;
-                    fieldCardFrame.player = this;
+                    FieldCardFrame fieldCardFrame = new FieldCardFrame
+                    {
+                        Frame = BattleAreaFrameParent.GetChild(i).GetChild(0).gameObject,
+                        Frame_Select = BattleAreaFrameParent.GetChild(i).GetChild(1).GetComponent<Image>(),
+                        FrameID = count,
+                        player = this
+                    };
                     fieldCardFrame.Frame.GetComponent<Image>().color = new Color(0, 0, 0, 0);
                     fieldCardFrame.Frame_Select.color = new Color(0, 0, 0, 0);
                     fieldCardFrames.Add(fieldCardFrame);
@@ -39,11 +41,13 @@ public class Player : MonoBehaviour
 
             if (BreedingAreaFrameParent.childCount >= 2)
             {
-                FieldCardFrame fieldCardFrame = new FieldCardFrame();
-                fieldCardFrame.Frame = BreedingAreaFrameParent.GetChild(0).gameObject;
-                fieldCardFrame.Frame_Select = BreedingAreaFrameParent.GetChild(1).GetComponent<Image>();
-                fieldCardFrame.FrameID = count;
-                fieldCardFrame.player = this;
+                FieldCardFrame fieldCardFrame = new FieldCardFrame
+                {
+                    Frame = BreedingAreaFrameParent.GetChild(0).gameObject,
+                    Frame_Select = BreedingAreaFrameParent.GetChild(1).GetComponent<Image>(),
+                    FrameID = count,
+                    player = this
+                };
                 fieldCardFrame.Frame.GetComponent<Image>().color = new Color(0, 0, 0, 0);
                 fieldCardFrame.Frame_Select.color = new Color(0, 0, 0, 0);
                 fieldCardFrames.Add(fieldCardFrame);
@@ -412,7 +416,7 @@ public class Player : MonoBehaviour
             {
                 for (int i = 0; i < DeckCardImages.Count; i++)
                 {
-                    float targetY = 0;
+                    float targetY;
 
                     if (j % 2 == 0)
                     {
@@ -553,7 +557,7 @@ public class Player : MonoBehaviour
     {
         if (PlayMatSpriteRenderer_Original != null)
         {
-            string filiName = "";
+            string filiName;
 
             if (isYou)
             {
@@ -1128,7 +1132,7 @@ public class Player : MonoBehaviour
     {
         get
         {
-            int MaxMemoryCost = 0;
+            int MaxMemoryCost;
 
             if (PlayerID == 0)
             {
@@ -1668,8 +1672,6 @@ public class FieldCardFrame
             {
                 return player.fieldCardFrames[this.FrameID - 4];
             }
-
-            return null;
         }
     }
 }

+ 48 - 49
Assets/Scripts/Script/ResizeWindow.cs

@@ -1,13 +1,12 @@
-using System.Collections;
 using System.Collections.Generic;
-using System.Threading.Tasks;
 using UnityEngine;
 using Button = UnityEngine.UI.Button;
 using Toggle = UnityEngine.UI.Toggle;
-using System;
 
 public class ResizeWindow : MonoBehaviour
 {
+    private static readonly int OpenHash = Animator.StringToHash("Open");
+    private static readonly int CloseHash = Animator.StringToHash("Close");
     public Animator anim;
     public Toggle fullScreenToggle;
     public List<Button> switchWindowSizeButtons = new List<Button>();
@@ -20,8 +19,8 @@ public class ResizeWindow : MonoBehaviour
     {
         SetButtonsInteractable();
         gameObject.SetActive(true);
-        anim.SetInteger("Open", 1);
-        anim.SetInteger("Close", 0);
+        anim.SafeSetInt(OpenHash, 1);
+        anim.SafeSetInt(CloseHash, 0);
 
         if (fullScreenToggle != null)
         {
@@ -54,8 +53,8 @@ public class ResizeWindow : MonoBehaviour
             }
         }
 
-        anim.SetInteger("Open", 0);
-        anim.SetInteger("Close", 1);
+        anim.SafeSetInt(OpenHash, 0);
+        anim.SafeSetInt(CloseHash, 1);
     }
 
     public void SetUpWindowSize(string resolution)
@@ -64,59 +63,59 @@ public class ResizeWindow : MonoBehaviour
         return;
 #endif
 
-        if (Opening.instance != null)
-        {
-            Opening.instance.PlayDecisionSE();
-        }
-
-        else if (GManager.instance != null)
-        {
-            GManager.instance.PlayDecisionSE();
-        }
-
-        //float height = width / 16f * 9f;
-        int heightstring = 4;
-        if (resolution.Length <= 7)
-        {
-            heightstring = 3;
-        }
-        string temp = resolution.Substring(0, 4);
-        var width = int.Parse(temp);
-        temp = resolution.Substring(4, heightstring);
-        var height = int.Parse(temp);
-        //Screen.SetResolution((int)width, (int)height, false);
-        Screen.SetResolution((int)width, (int)height, UnityEngine.Device.Screen.fullScreen);
-        SetButtonsInteractable();
+        //if (Opening.instance != null)
+        //{
+        //    Opening.instance.PlayDecisionSE();
+        //}
+
+        //else if (GManager.instance != null)
+        //{
+        //    GManager.instance.PlayDecisionSE();
+        //}
+
+        ////float height = width / 16f * 9f;
+        //int heightstring = 4;
+        //if (resolution.Length <= 7)
+        //{
+        //    heightstring = 3;
+        //}
+        //string temp = resolution.Substring(0, 4);
+        //var width = int.Parse(temp);
+        //temp = resolution.Substring(4, heightstring);
+        //var height = int.Parse(temp);
+        ////Screen.SetResolution((int)width, (int)height, false);
+        //Screen.SetResolution((int)width, (int)height, UnityEngine.Device.Screen.fullScreen);
+        //SetButtonsInteractable();
     }
 
-    public async void SetFullScreen(Toggle isFullScreen)
+    public /*async*/ void SetFullScreen(Toggle isFullScreen)
     {
 #if UNITY_EDITOR || !UNITY_STANDALONE
         Debug.Log(isFullScreen.isOn);
         return;
 #endif
-        if (Opening.instance != null)
-        {
-            Opening.instance.PlayDecisionSE();
-        }
-
-        else if (GManager.instance != null)
-        {
-            GManager.instance.PlayDecisionSE();
-        }
-
-        UnityEngine.Device.Screen.fullScreen = isFullScreen.isOn;
-        await Task.Delay(TimeSpan.FromSeconds(Time.deltaTime));
-        SetButtonsInteractable();
+        //if (Opening.instance != null)
+        //{
+        //    Opening.instance.PlayDecisionSE();
+        //}
+
+        //else if (GManager.instance != null)
+        //{
+        //    GManager.instance.PlayDecisionSE();
+        //}
+
+        //UnityEngine.Device.Screen.fullScreen = isFullScreen.isOn;
+        //await Task.Delay(TimeSpan.FromSeconds(Time.deltaTime));
+        //SetButtonsInteractable();
     }
 
     void SetButtonsInteractable()
     {
         return;
 
-        foreach (Button button in switchWindowSizeButtons)
-        {
-            button.interactable = !UnityEngine.Device.Screen.fullScreen;
-        }
+        //foreach (Button button in switchWindowSizeButtons)
+        //{
+        //    button.interactable = !UnityEngine.Device.Screen.fullScreen;
+        //}
     }
-}
+}

+ 33 - 36
Assets/Scripts/Script/RoomManager.cs

@@ -12,6 +12,8 @@ using UnityEngine.Events;
 
 public class RoomManager : MonoBehaviourPunCallbacks
 {
+    private static WaitForSeconds _waitForSeconds1 = new WaitForSeconds(1f);
+    private static WaitForSeconds _waitForSeconds0_1 = new WaitForSeconds(0.1f);
     [SerializeField] bool _isReady = false;
     int playerCount { get; set; }
 
@@ -125,25 +127,27 @@ public class RoomManager : MonoBehaviourPunCallbacks
         while (true)
         {
             //Setting up the room to be created
-            RoomOptions roomOptions = new RoomOptions();
-            roomOptions.IsVisible = true;   //Make the room visible in the lobby
-            roomOptions.IsOpen = true;      //Allow other players to enter the room
-            roomOptions.PublishUserId = true;
+            RoomOptions roomOptions = new RoomOptions
+            {
+                IsVisible = true,   //Make the room visible in the lobby
+                IsOpen = true,      //Allow other players to enter the room
+                PublishUserId = true,
 
-            roomOptions.MaxPlayers = 2;
+                MaxPlayers = 2,
 
-            //Stores the creator's name to display the room creator in the room's custom properties
-            roomOptions.CustomRoomProperties = new Hashtable()
-            {
-                { "RoomCreator",PhotonNetwork.NickName },
-                { "UseBanlist", ContinuousController.instance.useBanlist }
-            };
+                //Stores the creator's name to display the room creator in the room's custom properties
+                CustomRoomProperties = new Hashtable()
+                {
+                    { "RoomCreator",PhotonNetwork.NickName },
+                    { "UseBanlist", ContinuousController.instance.useBanlist }
+                },
 
-            //Display custom property information in the lobby
-            roomOptions.CustomRoomPropertiesForLobby = new string[]
-            {
-                "RoomCreator",
-                "UseBanlist"
+                //Display custom property information in the lobby
+                CustomRoomPropertiesForLobby = new string[]
+                {
+                    "RoomCreator",
+                    "UseBanlist"
+                }
             };
 
             string RoomName = StringUtils.GeneratePassword_Num(5);
@@ -241,7 +245,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
 
         #region RoomName
         string RoomName = PhotonNetwork.CurrentRoom.Name;
-        RoomIDText.text = RoomName.Substring(0,5);
+        RoomIDText.text = RoomName[..5];
         #endregion
     }
     #endregion
@@ -323,7 +327,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
             Opening.instance.battle.selectBattleMode.StartSelectRoomMatch();
         }
 
-        yield return new WaitForSeconds(0.1f);
+        yield return _waitForSeconds0_1;
 
         yield return ContinuousController.instance.StartCoroutine(disconnectLoadingObject.EndLoading());
     }
@@ -375,9 +379,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
     {
         Hashtable PlayerProp = player.CustomProperties;
 
-        object value;
-
-        if (PlayerProp.TryGetValue(ReadyKey(), out value))
+        if (PlayerProp.TryGetValue(ReadyKey(), out object _))
         {
             PlayerProp[ReadyKey()] = _isReady;
         }
@@ -396,9 +398,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
     {
         foreach (var p in PhotonNetwork.PlayerList)
         {
-            object value;
-
-            if (p.CustomProperties.TryGetValue(ReadyKey(), out value))
+            if (p.CustomProperties.TryGetValue(ReadyKey(), out object value))
             {
                 if (!(bool)value)
                 {
@@ -497,7 +497,6 @@ public class RoomManager : MonoBehaviourPunCallbacks
     IEnumerator GoToBattleSceneCoroutine()
     {
         yield return ContinuousController.instance.StartCoroutine(Opening.instance.LoadingObject_Unload.StartLoading("Now Loading"));
-        object value;
 
         DoneStartBattle = true;
 
@@ -514,14 +513,14 @@ public class RoomManager : MonoBehaviourPunCallbacks
         {
             if (dictionaryEntry.Key.ToString().Contains("PhotonWaitController"))
             {
-                if (PlayerProp.TryGetValue(dictionaryEntry.Key.ToString(), out value))
+                if (PlayerProp.TryGetValue(dictionaryEntry.Key.ToString(), out _))
                 {
                     PlayerProp.Remove(dictionaryEntry.Key.ToString());
                 }
             }
         }
 
-        if (PlayerProp.TryGetValue("isBattle", out value))
+        if (PlayerProp.TryGetValue("isBattle", out _))
         {
             PlayerProp["isBattle"] = true;
         }
@@ -531,7 +530,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
             PlayerProp.Add("isBattle", true);
         }
 
-        if (PlayerProp.TryGetValue(ReadyKey(), out value))
+        if (PlayerProp.TryGetValue(ReadyKey(), out _))
         {
             PlayerProp[ReadyKey()] = false;
         }
@@ -544,7 +543,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
         PlayerProp[ContinuousController.DeckDataPropertyKey] = ContinuousController.instance.BattleDeckData.GetThisDeckCode();
 
         PhotonNetwork.LocalPlayer.SetCustomProperties(PlayerProp);
-        yield return new WaitForSeconds(0.1f);
+        yield return _waitForSeconds0_1;
 
         //Opening.instance.MainCamera.gameObject.SetActive(false);
 
@@ -555,7 +554,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
 
         ContinuousController.instance.StartCoroutine(Opening.instance.OpeningBGM.FadeOut(0.5f));
 
-        yield return new WaitForSeconds(1f);
+        yield return _waitForSeconds1;
 
         SceneManager.LoadSceneAsync("BattleScene", LoadSceneMode.Additive);
         yield return ContinuousController.instance.StartCoroutine(Opening.instance.LoadingObject_Unload.EndLoading());
@@ -575,9 +574,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
         {
             GameObject PlayerElement = Instantiate(PlayerElementPrefab, PlayerParent.transform);
 
-            object value;
-
-            string PlayerName = "Player";
+            string PlayerName;
 
             #region Get player name from custom property
             if (PhotonNetwork.PlayerList[i] == PhotonNetwork.LocalPlayer)
@@ -592,7 +589,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
 
             Hashtable hash = PhotonNetwork.PlayerList[i].CustomProperties;
 
-            if (hash.TryGetValue(ContinuousController.PlayerNameKey, out value))
+            if (hash.TryGetValue(ContinuousController.PlayerNameKey, out object value))
             {
                 PlayerName = (string)value;
             }
@@ -803,7 +800,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
         if (PhotonNetwork.InRoom)
         {
             #region クリップボードにデッキコードをコピー
-            GUIUtility.systemCopyBuffer = PhotonNetwork.CurrentRoom.Name.Substring(0, 5);
+            GUIUtility.systemCopyBuffer = PhotonNetwork.CurrentRoom.Name[..5];
             #endregion
 
             List<UnityAction> Commands = new List<UnityAction>()
@@ -878,7 +875,7 @@ public class RoomManager : MonoBehaviourPunCallbacks
 
         Hashtable RoomProp = PhotonNetwork.CurrentRoom.CustomProperties;
 
-        if (RoomProp.TryGetValue(DataBase.FirstPlayerIndexIdKey, out object value))
+        if (RoomProp.TryGetValue(DataBase.FirstPlayerIndexIdKey, out object _))
         {
             RoomProp[DataBase.FirstPlayerIndexIdKey] = firstPlayerIndexID;
         }

+ 4 - 4
Assets/Scripts/Script/SelectAssemblyClass.cs

@@ -9,6 +9,8 @@ using UnityEngine.Events;
 
 public class SelectAssemblyClass : MonoBehaviourPunCallbacks
 {
+    private static WaitForSeconds _waitForSeconds0_4 = new WaitForSeconds(0.4f);
+
     public List<CardSource> selectedAssemblyCards { get; private set; } = new List<CardSource>();
     public List<AddDigivolutionCardsInfo> addDigivolutionCardInfos { get; private set; } = new List<AddDigivolutionCardsInfo>();
     public List<CardSource> excludedCards { get; private set; } = new List<CardSource>();
@@ -202,7 +204,7 @@ public class SelectAssemblyClass : MonoBehaviourPunCallbacks
 
         if (selectedAssemblyCards.Count >= 1)
         {
-            yield return new WaitForSeconds(0.4f);
+            yield return _waitForSeconds0_4;
         }
 
         GManager.instance.GetComponent<Effects>().OffShowCard2();
@@ -259,7 +261,7 @@ public class SelectAssemblyClass : MonoBehaviourPunCallbacks
                     {
                         if (AssemblyConditionElement.CanTargetCondition_ByPreSelecetedList != null || AssemblyConditionElement.skipAllIfNoSelect)
                         {
-                            EndSelectAssembly();
+                            yield return StartCoroutine(EndSelectAssembly());
                         }
                     }
                 }
@@ -324,8 +326,6 @@ public class SelectAssemblyClass : MonoBehaviourPunCallbacks
 
                     foreach (AddDigivolutionCardsInfo info in addDigivolutionCardInfos)
                     {
-                        List<CardSource> underTamerCards = new List<CardSource>();
-                        List<Permanent> digimonPermanents = new List<Permanent>();
                         List<CardSource> trashCards = new List<CardSource>();
 
                         foreach (CardSource cardSource in info.cardSources)

+ 22 - 22
Assets/Scripts/Script/SelectBattleDeck.cs

@@ -1,14 +1,14 @@
 using System.Collections;
-using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
-using System;
 using UnityEngine.Events;
-using UnityEngine.SceneManagement;
-using System.Linq;
+using System.Threading.Tasks;
 
 public class SelectBattleDeck : MonoBehaviour
 {
+    private static readonly int OpenHash = Animator.StringToHash("Open");
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static WaitForSeconds _waitForSeconds1 = new WaitForSeconds(1f);
     [Header("Deck selection object")]
     public GameObject SelectDeckObject;
 
@@ -65,10 +65,10 @@ public class SelectBattleDeck : MonoBehaviour
         }
     }
 
-    bool once = false;
+    bool _once = false;
     public void OnClickSelectButton_RandomMatch()
     {
-        if (once || deckInfoPanel.ShowingDeckData == null)
+        if (_once || deckInfoPanel.ShowingDeckData == null)
         {
             return;
         }
@@ -82,7 +82,7 @@ public class SelectBattleDeck : MonoBehaviour
 
     public void OnClickSelectButton_BotMatch()
     {
-        if (once || deckInfoPanel.ShowingDeckData == null)
+        if (_once || deckInfoPanel.ShowingDeckData == null)
         {
             return;
         }
@@ -94,7 +94,7 @@ public class SelectBattleDeck : MonoBehaviour
 
     public IEnumerator OnClickSelectButton_RoomMatchCoroutine()
     {
-        if (once || deckInfoPanel.ShowingDeckData == null)
+        if (_once || deckInfoPanel.ShowingDeckData == null)
         {
             yield break;
         }
@@ -110,9 +110,9 @@ public class SelectBattleDeck : MonoBehaviour
 
     IEnumerator SetOnce()
     {
-        once = true;
-        yield return new WaitForSeconds(1f);
-        once = false;
+        _once = true;
+        yield return _waitForSeconds1;
+        _once = false;
     }
 
     public void Off()
@@ -132,7 +132,7 @@ public class SelectBattleDeck : MonoBehaviour
 
     public UnityAction OnCloseSelectBattleDeckAction;
 
-    public async void SetUpSelectBattleDeck(UnityAction OnClickSelectButtonAction, int defaulSelectDeckIndex)
+    public async void SetUpSelectBattleDeck(UnityAction OnClickSelectButtonAction, int _)
     {
         if (SelectDeckObject.activeSelf)
         {
@@ -145,8 +145,8 @@ public class SelectBattleDeck : MonoBehaviour
 
         SelectDeckObject.SetActive(true);
 
-        anim.SetInteger("Open", 1);
-        anim.SetInteger("Close", 0);
+        anim.SafeSetInt(OpenHash, 1);
+        anim.SafeSetInt(CloseHash, 0);
 
         ContinuousController.instance.StartCoroutine(SetDeckList(true));
 
@@ -168,7 +168,7 @@ public class SelectBattleDeck : MonoBehaviour
 
         else
         {
-            ResetDeckInfoPanel();
+            await ResetDeckInfoPanel();
         }
 
         /*
@@ -178,7 +178,7 @@ public class SelectBattleDeck : MonoBehaviour
         }
         */
 
-        string message = "";
+        string message;
 
         if (ContinuousController.instance.isAI)
         {
@@ -226,13 +226,13 @@ public class SelectBattleDeck : MonoBehaviour
             Opening.instance.PlayCancelSE();
         }
 
-        anim.SetInteger("Open", 0);
-        anim.SetInteger("Close", 1);
+        anim.SafeSetInt(OpenHash, 0);
+        anim.SafeSetInt(CloseHash, 1);
     }
 
-    public void ResetDeckInfoPanel()
+    public async Task ResetDeckInfoPanel()
     {
-        deckInfoPanel.SetUpDeckInfoPanel(null);
+        await deckInfoPanel.SetUpDeckInfoPanel(null);
     }
 
     public IEnumerator SetDeckList(bool open)
@@ -256,9 +256,9 @@ public class SelectBattleDeck : MonoBehaviour
 
             _deckInfoPrefab.transform.localScale = Opening.instance.DeckInfoPrefabStartScale * 1.02f;
 
-            _deckInfoPrefab.OnClickAction = (deckdata) =>
+            _deckInfoPrefab.OnClickAction = async (deckdata) =>
             {
-                deckInfoPanel.SetUpDeckInfoPanel(deckdata);
+                await deckInfoPanel.SetUpDeckInfoPanel(deckdata);
 
                 SetSelectDeckButton();
 

+ 6 - 6
Assets/Scripts/Script/SelectDNACondition.cs

@@ -3,7 +3,6 @@ using System.Collections.Generic;
 using UnityEngine;
 using Photon.Pun;
 using System;
-using System.Linq;
 
 
 public class SelectDNACondition : MonoBehaviourPunCallbacks
@@ -11,14 +10,15 @@ public class SelectDNACondition : MonoBehaviourPunCallbacks
     public void SetUp
         (Player SelectPlayer,
         CardSource targetDNA,
-        Func<int, IEnumerator> SelectDNACoroutine)
+        Func<int, IEnumerator> SelectDNACoroutine,
+        bool IsLocal = false)
     {
         _selectPlayer = SelectPlayer;
         _targetDNA = targetDNA;
         _selectDNACoroutine = SelectDNACoroutine;
         _notDoSync = false;
-        _isDigivolutionCost = false;
-    }
+        _isLocal = IsLocal;
+}
 
     Player _selectPlayer = null;
     CardSource _targetDNA = null;
@@ -26,7 +26,7 @@ public class SelectDNACondition : MonoBehaviourPunCallbacks
     List<int> _candidates = new List<int>();
     public int _selectedCount = 0;
     bool _notDoSync = false;
-    bool _isDigivolutionCost = false;
+    bool _isLocal = false;
 
     public void ResetSelectDNAConditionClass()
     {
@@ -68,7 +68,7 @@ public class SelectDNACondition : MonoBehaviourPunCallbacks
                 string selectPlayerMessage = "Which DNA do you want?";
                 string notSelectPlayerMessage = "The opponent is choosing from which DNA to do.";
 
-                GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements, selectPlayer: _targetDNA.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements, selectPlayer: _targetDNA.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage, _isLocal);
 
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 

+ 11 - 10
Assets/Scripts/Script/SelectDeck.cs

@@ -2,11 +2,12 @@
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
-using System;
 using UnityEngine.Events;
 
 public class SelectDeck : OffAnimation
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     [Header("Select Deck Object")]
     public GameObject SelectDeckObject;
 
@@ -27,8 +28,8 @@ public class SelectDeck : OffAnimation
     public void OffSelectDeck()
     {
         anim.enabled = true;
-        anim.SetInteger("Open", 0);
-        anim.SetInteger("Close", 1);
+        anim.SafeSetInt(OpenHash, 0);
+        anim.SafeSetInt(CloseHash, 1);
 
         isOpen = false;
     }
@@ -53,7 +54,7 @@ public class SelectDeck : OffAnimation
             lastBattleDeckDataIndex = ContinuousController.instance.DeckDatas.IndexOf(ContinuousController.instance.LastBattleDeckData);
         }
 
-        ContinuousController.instance.ModifyAllDeckDatas();
+        //ContinuousController.instance.ModifyAllDeckDatas();
 
         if (0 <= lastBattleDeckDataIndex && lastBattleDeckDataIndex <= ContinuousController.instance.DeckDatas.Count - 1)
         {
@@ -68,8 +69,8 @@ public class SelectDeck : OffAnimation
 
         SelectDeckObject.SetActive(true);
 
-        anim.SetInteger("Open", 1);
-        anim.SetInteger("Close", 0);
+        anim.SafeSetInt(OpenHash, 1);
+        anim.SafeSetInt(CloseHash, 0);
 
         if (ContinuousController.instance.DeckDatas.Count > 0)
         {
@@ -120,9 +121,9 @@ public class SelectDeck : OffAnimation
 
             _deckInfoPrefab.transform.localScale = Opening.instance.DeckInfoPrefabStartScale * 1.02f;
 
-            _deckInfoPrefab.OnClickAction = (deckdata) =>
+            _deckInfoPrefab.OnClickAction = async (deckdata) =>
             {
-                deckInfoPanel.SetUpDeckInfoPanel(deckdata);
+                await deckInfoPanel.SetUpDeckInfoPanel(deckdata);
 
                 Opening.instance.CreateOnClickEffect();
             };
@@ -284,7 +285,7 @@ public class SelectDeck : OffAnimation
         }
 
         ContinuousController.instance.StartCoroutine(SetDeckList(false));
-        ContinuousController.instance.SaveDeckDatas();
+        //ContinuousController.instance.SaveDeckDatas();
     }
 
     public void OnClickDeleteAllDecksButton()
@@ -307,7 +308,7 @@ public class SelectDeck : OffAnimation
 
                 ContinuousController.instance.StartCoroutine(SetDeckList(false));
                 ResetDeckInfoPanel();
-                ContinuousController.instance.SaveDeckDatas();
+                //ContinuousController.instance.SaveDeckDatas();
                 ContinuousController.instance.DeleteAllDecks();
             }
                     ,null

+ 1 - 1
Assets/Scripts/Script/SelectJogressEffect.cs

@@ -187,7 +187,7 @@ public class SelectJogressEffect : MonoBehaviour
             {
                 #region select DNA condition
                 SelectDNACondition selectDNACondition = GManager.instance.GetComponent<SelectDNACondition>();
-                selectDNACondition.SetUp(_card.Owner, _card, SelectDNA);
+                selectDNACondition.SetUp(_card.Owner, _card, SelectDNA, _isLocal);
 
                 yield return ContinuousController.instance.StartCoroutine(selectDNACondition.Activate());
 

+ 8 - 9
Assets/Scripts/Script/ServerRegionPanel.cs

@@ -1,11 +1,10 @@
-using System;
-using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
-using UnityEngine.Events;
-using UnityEngine.UI;
+
 public class ServerRegionPanel : OffAnimation
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     [SerializeField] Animator _anim;
     [SerializeField] List<ServerRegionToggle> _serverRegionToggles = new();
 
@@ -29,8 +28,8 @@ public class ServerRegionPanel : OffAnimation
             }
         }
 
-        _anim.SetInteger("Open", 0);
-        _anim.SetInteger("Close", 1);
+        _anim.SafeSetInt(OpenHash, 0);
+        _anim.SafeSetInt(CloseHash, 1);
     }
 
     public void Init()
@@ -44,7 +43,7 @@ public class ServerRegionPanel : OffAnimation
         {
             foreach (ServerRegionToggle serverRegionToggle in _serverRegionToggles)
             {
-                void OnToggleChange(string region)
+                static void OnToggleChange(string region)
                 {
                     ContinuousController.instance.serverRegion = region;
                     ContinuousController.instance.SaveServerRegion();
@@ -57,7 +56,7 @@ public class ServerRegionPanel : OffAnimation
         }
 
         gameObject.SetActive(true);
-        _anim.SetInteger("Open", 1);
-        _anim.SetInteger("Close", 0);
+        _anim.SafeSetInt(OpenHash, 1);
+        _anim.SafeSetInt(CloseHash, 0);
     }
 }

+ 1 - 1
Assets/Scripts/Script/SimpleCircleLayoutGroup.cs

@@ -28,7 +28,7 @@ public class SimpleCircleLayoutGroup : UIBehaviour, ILayoutGroup
 	void Arrange()
 	{
 		float splitAngle = 360 / transform.childCount;
-		var rect = transform as RectTransform;
+		//var rect = transform as RectTransform;
 
 		for (int elementId = 0; elementId < transform.childCount; elementId++)
 		{

+ 2 - 2
Assets/Scripts/Script/SpellRestoration.cs

@@ -90,9 +90,9 @@ public class SpellRestoration
 
             return restoreData;
         }
-        catch (System.FormatException exception)
+        catch (System.FormatException)
         {
-            return default(T);
+            return default;
         }
     }
 }

+ 3 - 3
Assets/Scripts/Script/Title.cs

@@ -19,7 +19,7 @@ public class Title : MonoBehaviour
         anim.enabled = true;
     }
 
-    bool Clicked = false;
+    bool _clicked = false;
     public List<TextMeshProUGUI> titleTexts = new List<TextMeshProUGUI>();
     public CheckUpdate checkUpdate;
     public GameObject Parent;
@@ -27,12 +27,12 @@ public class Title : MonoBehaviour
     public GameObject ClickToStart;
     public void OnClick()
     {
-        if(Clicked)
+        if(_clicked)
         {
             return;
         }
 
-        Clicked = true;
+        _clicked = true;
 
         ContinuousController.instance.StartCoroutine(OnClickCoroutine());
     }

+ 31 - 29
Assets/Scripts/Script/TrialDraw.cs

@@ -1,4 +1,4 @@
-using System.Collections;
+using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
@@ -6,6 +6,8 @@ using UnityEngine.EventSystems;
 
 public class TrialDraw : MonoBehaviour
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     public CardPrefab_CreateDeck cardPrefab_CreateDeckPrefab;
     public Animator anim;
 
@@ -14,9 +16,9 @@ public class TrialDraw : MonoBehaviour
 
     public Text DeckCountText;
 
-    List<CEntity_Base> originalDeckCards = new List<CEntity_Base>();
-    List<CEntity_Base> deckCards = new List<CEntity_Base>();
-    List<CEntity_Base> drewCards = new List<CEntity_Base>();
+    List<CEntity_Base> _originalDeckCards = new List<CEntity_Base>();
+    List<CEntity_Base> _deckCards = new List<CEntity_Base>();
+    List<CEntity_Base> _drewCards = new List<CEntity_Base>();
 
     public Button drawButton;
 
@@ -29,14 +31,14 @@ public class TrialDraw : MonoBehaviour
 
         detailCard.OffDetailCard();
 
-        originalDeckCards = new List<CEntity_Base>();
+        _originalDeckCards = new List<CEntity_Base>();
 
         foreach (CEntity_Base cEntity_Base in cEntity_Bases)
         {
-            originalDeckCards.Add(cEntity_Base);
+            _originalDeckCards.Add(cEntity_Base);
         }
 
-        yield return ContinuousController.instance.StartCoroutine(Set(originalDeckCards));
+        yield return ContinuousController.instance.StartCoroutine(Set(_originalDeckCards));
     }
 
     IEnumerator Set(List<CEntity_Base> cEntity_Bases)
@@ -45,15 +47,15 @@ public class TrialDraw : MonoBehaviour
 
         drawButton.transform.parent.gameObject.SetActive(false);
 
-        deckCards = new List<CEntity_Base>();
-        drewCards = new List<CEntity_Base>();
+        _deckCards = new List<CEntity_Base>();
+        _drewCards = new List<CEntity_Base>();
 
         foreach (CEntity_Base cEntity_Base in cEntity_Bases)
         {
-            deckCards.Add(cEntity_Base);
+            _deckCards.Add(cEntity_Base);
         }
 
-        deckCards = RandomUtility.ShuffledDeckCards(deckCards);
+        _deckCards = RandomUtility.ShuffledDeckCards(_deckCards);
 
         //detailCard.OffDetailCard();
 
@@ -69,24 +71,24 @@ public class TrialDraw : MonoBehaviour
             DrawCard();
         }
 
-        yield return new WaitWhile(() => CardScroll.content.childCount < drewCards.Count);
+        yield return new WaitWhile(() => CardScroll.content.childCount < _drewCards.Count);
 
         this.gameObject.SetActive(true);
 
         Open();
 
-        drawButton.interactable = deckCards.Count >= 1;
+        drawButton.interactable = _deckCards.Count >= 1;
 
-        drawButton.transform.parent.gameObject.SetActive(deckCards.Count >= 1);
+        drawButton.transform.parent.gameObject.SetActive(_deckCards.Count >= 1);
     }
 
     public void DrawCard()
     {
-        if (deckCards.Count >= 1)
+        if (_deckCards.Count >= 1)
         {
-            CEntity_Base drewCard = deckCards[0];
-            deckCards.Remove(drewCard);
-            drewCards.Add(drewCard);
+            CEntity_Base drewCard = _deckCards[0];
+            _deckCards.Remove(drewCard);
+            _drewCards.Add(drewCard);
 
             CardPrefab_CreateDeck _cardPrefab_CreateDeck = null;
 
@@ -105,9 +107,9 @@ public class TrialDraw : MonoBehaviour
 
         EventSystem.current.SetSelectedGameObject(transform.GetChild(0).gameObject);
 
-        drawButton.interactable = deckCards.Count >= 1;
+        drawButton.interactable = _deckCards.Count >= 1;
 
-        drawButton.transform.parent.gameObject.SetActive(deckCards.Count >= 1);
+        drawButton.transform.parent.gameObject.SetActive(_deckCards.Count >= 1);
 
         SetDeckCountText();
     }
@@ -122,15 +124,15 @@ public class TrialDraw : MonoBehaviour
     public void Open()
     {
         On();
-        anim.SetInteger("Open", 1);
-        anim.SetInteger("Close", 0);
+        anim.SafeSetInt(OpenHash, 1);
+        anim.SafeSetInt(CloseHash, 0);
     }
 
     public void Close()
     {
         //OffDetailCard();
-        anim.SetInteger("Open", 0);
-        anim.SetInteger("Close", 1);
+        anim.SafeSetInt(OpenHash, 0);
+        anim.SafeSetInt(CloseHash, 1);
     }
 
     public void On()
@@ -174,11 +176,11 @@ public class TrialDraw : MonoBehaviour
     public void SetDeckCountText()
     {
         DeckCountText.text = LocalizeUtility.GetLocalizedString(
-            EngMessage: $"Remaining Cards in Deck : {deckCards.Count}/{originalDeckCards.Count}",
-            JpnMessage: $"�f�b�LŽc‚č–‡�” : {deckCards.Count}/{originalDeckCards.Count}"
+            EngMessage: $"Remaining Cards in Deck : {_deckCards.Count}/{_originalDeckCards.Count}",
+            JpnMessage: $"??? : {_deckCards.Count}/{_originalDeckCards.Count}"
         );
 
-        if (deckCards.Count >= 1)
+        if (_deckCards.Count >= 1)
         {
             DeckCountText.color = new Color32(255, 255, 255, 255);
         }
@@ -191,7 +193,7 @@ public class TrialDraw : MonoBehaviour
 
     public void OnClickRedrawButton()
     {
-        ContinuousController.instance.StartCoroutine(Set(originalDeckCards));
+        ContinuousController.instance.StartCoroutine(Set(_originalDeckCards));
         ContinuousController.instance.PlaySE(Opening.instance.DrawSE);
     }
 
@@ -206,4 +208,4 @@ public class TrialDraw : MonoBehaviour
         ContinuousController.instance.PlaySE(Opening.instance.CancelSE);
         Close();
     }
-}
+}

+ 21 - 18
Assets/Scripts/Script/TurnStateMachine.cs

@@ -13,6 +13,8 @@ using static UnityEngine.ParticleSystem;
 using static UnityEngine.UIElements.UxmlAttributeDescription;
 public class TurnStateMachine : MonoBehaviourPunCallbacks
 {
+    private static WaitForSeconds _waitForSeconds0_2 = new WaitForSeconds(0.2f);
+
     //Class to manage battle status
     public GameContext gameContext;
 
@@ -70,12 +72,14 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
             if (!PhotonNetwork.InRoom)
             {
                 //Setting up the room to be created
-                RoomOptions roomOptions = new RoomOptions();
-                roomOptions.IsVisible = false;   //Make the room invisible in the lobby.
-                roomOptions.IsOpen = false;      //Not Allow other players to enter the room
-                roomOptions.PublishUserId = true;
+                RoomOptions roomOptions = new RoomOptions
+                {
+                    IsVisible = false,   //Make the room invisible in the lobby.
+                    IsOpen = false,      //Not Allow other players to enter the room
+                    PublishUserId = true,
 
-                roomOptions.MaxPlayers = 1;
+                    MaxPlayers = 1
+                };
 
                 string RoomName = StringUtils.GeneratePassword_AlpahabetNum(50);
 
@@ -147,7 +151,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                             return "Opponent";
                         }
 
-                        return playerName;
+                        //return playerName;
                     }
                 }
 
@@ -231,7 +235,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
 
         #region デッキカード生成
         yield return StartCoroutine(CardObjectController.CreatePlayerDecks(GManager.instance.CardPrefab, gameContext));
-        yield return new WaitForSeconds(0.2f);
+        yield return _waitForSeconds0_2;
         #endregion
 
         /*#region ログのクリック処理を追加
@@ -1736,7 +1740,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                                         handCard1.RemoveDragTarget();
                                         handCard1.RemoveSelectEffect();
                                         handCard1.handCardCommandPanel.CloseCommandPanel();
-                                        handCard1.Outline_Select.gameObject.SetActive(false);
+                                        handCard1.Outline_Select.SetActive(false);
                                     }
 
                                     foreach (Player player in gameContext.Players)
@@ -2136,7 +2140,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
 
                                                     OffHandCardTarget(gameContext.TurnPlayer);
 
-                                                    handCard.Outline_Select.gameObject.SetActive(false);
+                                                    handCard.Outline_Select.SetActive(false);
 
                                                     foreach (Player player in gameContext.Players_ForTurnPlayer)
                                                     {
@@ -2505,7 +2509,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
 
                                             OffHandCardTarget(gameContext.TurnPlayer);
 
-                                            handCard.Outline_Select.gameObject.SetActive(false);
+                                            handCard.Outline_Select.SetActive(false);
 
                                             foreach (Player player in gameContext.Players_ForTurnPlayer)
                                             {
@@ -2542,7 +2546,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
 
                                         OffHandCardTarget(gameContext.TurnPlayer);
 
-                                        handCard.Outline_Select.gameObject.SetActive(false);
+                                        handCard.Outline_Select.SetActive(false);
 
                                         foreach (Player player in gameContext.Players_ForTurnPlayer)
                                         {
@@ -2789,7 +2793,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                         #region Reset cards in hand
                         foreach (HandCard handCard1 in gameContext.TurnPlayer.HandCardObjects)
                         {
-                            handCard.Outline_Select.gameObject.SetActive(false);
+                            handCard1.Outline_Select.SetActive(false);
                             handCard1.RemoveSelectEffect();
                             handCard1.RemoveClickTarget();
                             handCard1.RemoveDragTarget();
@@ -2838,7 +2842,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                                         #region Reset cards in hand
                                         foreach (HandCard handCard1 in gameContext.TurnPlayer.HandCardObjects)
                                         {
-                                            handCard.Outline_Select.gameObject.SetActive(false);
+                                            handCard1.Outline_Select.SetActive(false);
                                             handCard1.RemoveSelectEffect();
                                             handCard1.RemoveClickTarget();
                                             handCard1.RemoveDragTarget();
@@ -2858,7 +2862,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
 
                         handCard.AddClickTarget((_fieldUnitCard) => StartCoroutine(SetMainPhase()));
 
-                        handCard.Outline_Select.gameObject.SetActive(true);
+                        handCard.Outline_Select.SetActive(true);
                         handCard.SetOrangeOutline();
                     }
 
@@ -2985,7 +2989,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                 handCard.RemoveSelectEffect();
                 handCard.RemoveClickTarget();
                 handCard.RemoveDragTarget();
-                handCard.Outline_Select.gameObject.SetActive(false);
+                handCard.Outline_Select.SetActive(false);
                 handCard.transform.GetChild(0).gameObject.SetActive(true);
             }
 
@@ -3037,8 +3041,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
             return;
         }
 
-        MainPhaseAction action = GamePacketFactory.Create(packetId, bytes) as MainPhaseAction;
-        if (action != null)
+        if (GamePacketFactory.Create(packetId, bytes) is MainPhaseAction action)
         {
             player.QueueMainPhaseAction(action);
         }
@@ -3245,7 +3248,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
     public bool endGame { get; set; } = false;
     public void OnClickSurrenderButton()
     {
-        int localPlayerID = 0;
+        int localPlayerID;
 
         if (PhotonNetwork.IsMasterClient)
         {

+ 35 - 22
Assets/Scripts/Script/UserSelectionManager.cs

@@ -9,6 +9,7 @@ public class UserSelectionManager : MonoBehaviourPunCallbacks
 {
     bool _endSelect = false;
     int _selectedIntValue = 0;
+    bool _isLocal = false;
     bool _selectedBoolValue => getBoolFromInt(_selectedIntValue);
     public int SelectedIntValue => _selectedIntValue;
     public bool SelectedBoolValue => _selectedBoolValue;
@@ -98,11 +99,12 @@ public class UserSelectionManager : MonoBehaviourPunCallbacks
         yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
     }
 
-    public void SetIntSelection(List<SelectionElement<int>> selectionElements, Player selectPlayer, string selectPlayerMessage, string notSelectPlayerMessage)
+    public void SetIntSelection(List<SelectionElement<int>> selectionElements, Player selectPlayer, string selectPlayerMessage, string notSelectPlayerMessage, bool IsLocal = false)
     {
         _endSelect = false;
         _selectedIntValue = 0;
         _selectPlayer = selectPlayer;
+        _isLocal = IsLocal;
 
         if (selectPlayer.isYou)
         {
@@ -112,7 +114,7 @@ public class UserSelectionManager : MonoBehaviourPunCallbacks
 
             foreach (SelectionElement<int> selectionElement in selectionElements)
             {
-                command_SelectCommands.Add(new Command_SelectCommand(selectionElement.Message, () => SetInt_RPC(selectPlayer.PlayerID, selectionElement.Value), selectionElement.SpriteIndex));
+                command_SelectCommands.Add(new Command_SelectCommand(selectionElement.Message, () => SendSelection(selectionElement.Value), selectionElement.SpriteIndex));
             }
 
             GManager.instance.selectCommandPanel.SetUpCommandButton(command_SelectCommands);
@@ -132,25 +134,31 @@ public class UserSelectionManager : MonoBehaviourPunCallbacks
                     canSelectValue.Add(selectionElement.Value);
                 }
 
-                if (canSelectValue.Count >= 1)
-                {
-                    SetInt_RPC(selectPlayer.PlayerID, canSelectValue[UnityEngine.Random.Range(0, canSelectValue.Count)]);
-                }
-
-                else
-                {
-                    SetInt_RPC(selectPlayer.PlayerID, 0);
-                }
+                int value = canSelectValue.Count >= 1 ? canSelectValue[UnityEngine.Random.Range(0, canSelectValue.Count)] : 0;
+                SendSelection(value);
             }
             #endregion
         }
+
+        void SendSelection(int value)
+        {
+            if (_isLocal)
+            {
+                SetIntForPlayer(selectPlayer.PlayerID, value);
+            }
+            else
+            {
+                SetInt_RPC(selectPlayer.PlayerID, value);
+            }
+        }
     }
 
-    public void SetBoolSelection(List<SelectionElement<bool>> selectionElements, Player selectPlayer, string selectPlayerMessage, string notSelectPlayerMessage)
+    public void SetBoolSelection(List<SelectionElement<bool>> selectionElements, Player selectPlayer, string selectPlayerMessage, string notSelectPlayerMessage, bool IsLocal = false)
     {
         _endSelect = false;
         _selectedIntValue = 0;
         _selectPlayer = selectPlayer;
+        _isLocal = IsLocal;
 
         if (selectPlayer.isYou)
         {
@@ -160,7 +168,7 @@ public class UserSelectionManager : MonoBehaviourPunCallbacks
 
             foreach (SelectionElement<bool> selectionElement in selectionElements)
             {
-                command_SelectCommands.Add(new Command_SelectCommand(selectionElement.Message, () => SetBool_RPC(selectPlayer.PlayerID, selectionElement.Value), selectionElement.SpriteIndex));
+                command_SelectCommands.Add(new Command_SelectCommand(selectionElement.Message, () => SendSelection(selectionElement.Value), selectionElement.SpriteIndex));
             }
 
             GManager.instance.selectCommandPanel.SetUpCommandButton(command_SelectCommands);
@@ -180,18 +188,23 @@ public class UserSelectionManager : MonoBehaviourPunCallbacks
                     canSelectValue.Add(selectionElement.Value);
                 }
 
-                if (canSelectValue.Count >= 1)
-                {
-                    SetBool_RPC(selectPlayer.PlayerID, canSelectValue[UnityEngine.Random.Range(0, canSelectValue.Count)]);
-                }
-
-                else
-                {
-                    SetBool_RPC(selectPlayer.PlayerID, false);
-                }
+                bool value = canSelectValue.Count >= 1 ? canSelectValue[UnityEngine.Random.Range(0, canSelectValue.Count)] : false;
+                SendSelection(value);
             }
             #endregion
         }
+
+        void SendSelection(bool value)
+        {
+            if (_isLocal)
+            {
+                SetBoolForPlayer(selectPlayer.PlayerID, value);
+            }
+            else
+            {
+                SetBool_RPC(selectPlayer.PlayerID, value);
+            }
+        }
     }
 }
 

+ 10 - 9
Assets/Scripts/Script/VolumePanel.cs

@@ -1,11 +1,12 @@
 using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.CompilerServices;
 using UnityEngine;
 using UnityEngine.UI;
 
 public class VolumePanel : MonoBehaviour
 {
+    private static WaitForSeconds _waitForSeconds0_15 = new WaitForSeconds(0.15f);
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     [Header("SEスライダー")]
     public Slider SESlier;
 
@@ -40,8 +41,8 @@ public class VolumePanel : MonoBehaviour
         });
 
         gameObject.SetActive(true);
-        anim.SetInteger("Open", 1);
-        anim.SetInteger("Close", 0);
+        anim.SafeSetInt(OpenHash, 1);
+        anim.SafeSetInt(CloseHash, 0);
     }
 
     public void Off()
@@ -69,8 +70,8 @@ public class VolumePanel : MonoBehaviour
             }
         }
 
-        anim.SetInteger("Open", 0);
-        anim.SetInteger("Close", 1);
+        anim.SafeSetInt(OpenHash, 0);
+        anim.SafeSetInt(CloseHash, 1);
     }
 
     float ConvertPlayerPrefsValueToSliderValue(float playerPrefsValue, Slider slider)
@@ -98,7 +99,7 @@ public class VolumePanel : MonoBehaviour
 
     bool _notPlaySample = false;
 
-    public void PlaySampleSE(float value)
+    public void PlaySampleSE(float _)
     {
         if (Opening.instance != null)
         {
@@ -123,7 +124,7 @@ public class VolumePanel : MonoBehaviour
     {
         _notPlaySample = true;
 
-        yield return new WaitForSeconds(0.15f);
+        yield return _waitForSeconds0_15;
 
         _notPlaySample = false;
     }
@@ -135,4 +136,4 @@ public class VolumePanel : MonoBehaviour
             ContinuousController.instance.SetBGMVolume(value);
         }
     }
-}
+}

+ 7 - 7
Assets/Scripts/Script/YesNoObject.cs

@@ -1,12 +1,12 @@
-using System.Collections;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 using UnityEngine.Events;
-using UnityEngine.EventSystems;
 
 public class YesNoObject : MonoBehaviour
 {
+    private static readonly int CloseHash = Animator.StringToHash("Close");
+    private static readonly int OpenHash = Animator.StringToHash("Open");
     public Text InfoText;
 
     public List<CommandButton> Buttons;
@@ -73,8 +73,8 @@ public class YesNoObject : MonoBehaviour
     public void Open()
     {
         this.gameObject.SetActive(true);
-        anim.SetInteger("Open", 1);
-        anim.SetInteger("Close", 0);
+        anim.SafeSetInt(OpenHash, 1);
+        anim.SafeSetInt(CloseHash, 0);
     }
 
     public void Close()
@@ -89,7 +89,7 @@ public class YesNoObject : MonoBehaviour
             Opening.instance.PlayCancelSE();
         }
 
-        anim.SetInteger("Open", 0);
-        anim.SetInteger("Close", 1);
+        anim.SafeSetInt(OpenHash, 0);
+        anim.SafeSetInt(CloseHash, 1);
     }
 }