In our game, players can create custom heroes and save them to disk. We show the player skeleton in many places in our game so I am working on writing a few methods that will accept a SkeletonAnimation and set it up according to the players chosen hero customizations.
The issue I'm running into is that I'd like to write a single method that can accept both a SkeletonAnimation and a SkeletonGraphic, otherwise I'm going to have to have duplicate code for each of these types.... And it appears that SkeletonAniamtion and SkeletonGraphic don't inherit from a shared base class???
for example:
public void CustomizeSkeletonByHero(ref SkeletonAnimation skeleton, TNet.DataNode customizationProfile)
{
// Customize my SkeletonAnimation here
}
public void CustomizeSkeletonByHero(ref SkeletonGraphic skeleton, TNet.DataNode customizationProfile)
{
// Customize my SkeletonGraphic here.... again
}
Any tips or ideas of how I can write code that accepts both of these types?