Last active
May 17, 2020 18:45
-
-
Save grofit/e89170d647e432041da6 to your computer and use it in GitHub Desktop.
Example of view separation with composition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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;} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SeparatedItem | |
{ | |
public string Name {get;set;} | |
public ItemType Type {get;set;} | |
public int Value {get;set;} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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