Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of view separation with composition
public class NoCompositionOrSeparationItem
{
public Sprite ItemImage;
public Vector3 InventoryPosition;
public Image ItemOverlay;
public string Name {get;set;}
public ItemType Type {get;set;}
public int Value {get;set;}
}
public class SeparatedItem
{
public string Name {get;set;}
public ItemType Type {get;set;}
public int Value {get;set;}
}
public class CompositionWithItem
{
public Sprite ItemImage;
public Vector3 InventoryPosition;
public Image ItemOverlay;
public SeparatedItem Item {get;set;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.