Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////
- // //
- // APPEND FUNCTION EXAMPLE //
- // //
- ///////////////////////////////
- using System;
- namespace RenegadeCore
- {
- public partial class StartingStats
- {
- public static readonly List<StatInfo> SpeciesStats;
- static StartingStats()
- {
- SpeciesStats = new List<StatInfo>()
- {
- new StatInfo("HP")
- new StatInfo("ATK")
- };
- }
- }
- }
- namespace AwesomeMod
- {
- public partial class StartingStats
- {
- [AppendFunction]
- static StartingStats()
- {
- SpeciesStats.Add(new StatInfo("DEF"));
- }
- }
- }
- //results in:
- using System;
- namespace RenegadeCore
- {
- public partial class StartingStats
- {
- public static readonly List<StatInfo> SpeciesStats;
- static StartingStats()
- {
- SpeciesStats = new List<StatInfo>()
- {
- new StatInfo("HP")
- new StatInfo("ATK")
- };
- //>>>>Added by AwesomeMod<<<<//
- SpeciesStats.Add(new StatInfo("DEF"));
- }
- }
- }
- ////////////////////////////////
- // //
- // PREPEND FUNCTION EXAMPLE //
- // //
- ////////////////////////////////
- using System;
- namespace RenegadeCore
- {
- public partial class StartingStats
- {
- public static readonly List<StatInfo> SpeciesStats;
- static StartingStats()
- {
- SpeciesStats = new List<StatInfo>()
- {
- new StatInfo("HP")
- new StatInfo("ATK")
- };
- }
- }
- }
- namespace AwesomeMod
- {
- public partial class StartingStats
- {
- [PrependFunction]
- static StartingStats()
- {
- //Fixing some stupid timing bug. If this isn't here, it causes a crash every tenth run.
- Thread.Wait(100);
- }
- }
- }
- //results in:
- using System;
- namespace RenegadeCore
- {
- public partial class StartingStats
- {
- public static readonly List<StatInfo> SpeciesStats;
- static StartingStats()
- {
- //>>>>Added by AwesomeMod<<<<//
- //Fixing some stupid timing bug. If this isn't here, it causes a crash every tenth run.
- Thread.Wait(100);
- SpeciesStats = new List<StatInfo>()
- {
- new StatInfo("HP")
- new StatInfo("ATK")
- };
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment