aeroson

Untitled

Nov 21st, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. MyBaseClass.cs
  2.  
  3. public abstract class MyBaseClass : MonoBehavior
  4. {
  5. public DataStorage DataStorage { get { return FindObjectOfType<DataStorageManager>().dataStorage; }}
  6. }
  7.  
  8.  
  9.  
  10.  
  11. ShowName.cs
  12.  
  13. public class ShowName : MyBaseClass
  14. {
  15. void OnStart()
  16. {
  17. GetComponent<Text>().text = DataStorage.playerName;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment