diff --git a/Pet/Modules/Shade.cs b/Pet/Modules/Shade.cs index 7203c6a..6510df9 100644 --- a/Pet/Modules/Shade.cs +++ b/Pet/Modules/Shade.cs @@ -77,7 +77,8 @@ private GameObject Create(Vector3 position) var shade = GameObject.Instantiate(go); GameObject.DontDestroyOnLoad(shade); shade.Find("Shade Particles").GetComponent().scalingMode = ParticleSystemScalingMode.Hierarchy; - shade.GetComponent().enabled = false; + shade.Find("Music Control").SetActive(false); + shade.RemoveComponents(); shade.RemoveComponents(); shade.RemoveComponents(); shade.transform.SetScaleMatching(0.5f); diff --git a/Pet/Pet.csproj b/Pet/Pet.csproj index f776650..242cb25 100644 --- a/Pet/Pet.csproj +++ b/Pet/Pet.csproj @@ -19,7 +19,7 @@ bin\$(Configuration)\ latest - 0.1.3.0 + 0.1.4.0 diff --git a/Pet/Utils/FsmUtils.cs b/Pet/Utils/FsmUtils.cs index 48a93c9..18f4966 100644 --- a/Pet/Utils/FsmUtils.cs +++ b/Pet/Utils/FsmUtils.cs @@ -35,6 +35,21 @@ public static int FindActionIndexByType(this FsmState state, Type actionType) return state.Actions.Select((a, i) => new { a, i }).First(ai => ai.a.GetType() == actionType).i; } + public static int FindActionIndexByType(this FsmState state) + { + return FindActionIndexByType(state, typeof(T)); + } + + public static FsmStateAction GetActionByType(this FsmState state, Type actionType) + { + return state.Actions.First(a => a.GetType() == actionType); + } + + public static FsmStateAction GetActionByType(this FsmState state) + { + return GetActionByType(state, typeof(T)); + } + internal class InsertParam { // what to insert