Skip to content

Commit

Permalink
feat: remove shade music
Browse files Browse the repository at this point in the history
  • Loading branch information
royitaqi committed Mar 5, 2023
1 parent 0bb2678 commit 66c6d45
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Pet/Modules/Shade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ private GameObject Create(Vector3 position)
var shade = GameObject.Instantiate(go);
GameObject.DontDestroyOnLoad(shade);
shade.Find("Shade Particles").GetComponent<ParticleSystem>().scalingMode = ParticleSystemScalingMode.Hierarchy;
shade.GetComponent<AudioSource>().enabled = false;
shade.Find("Music Control").SetActive(false);
shade.RemoveComponents<AudioSource>();
shade.RemoveComponents<HealthManager>();
shade.RemoveComponents<DamageHero>();
shade.transform.SetScaleMatching(0.5f);
Expand Down
2 changes: 1 addition & 1 deletion Pet/Pet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<FileVersion></FileVersion>
<OutputPath>bin\$(Configuration)\</OutputPath>
<LangVersion>latest</LangVersion>
<Version>0.1.3.0</Version>
<Version>0.1.4.0</Version>
</PropertyGroup>

<Target Name="ClearModAndExportDir" AfterTargets="PostBuildEvent">
Expand Down
15 changes: 15 additions & 0 deletions Pet/Utils/FsmUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(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<T>(this FsmState state)
{
return GetActionByType(state, typeof(T));
}

internal class InsertParam
{
// what to insert
Expand Down

0 comments on commit 66c6d45

Please sign in to comment.