Quantcast
Channel: Questions in topic: "get"
Viewing all articles
Browse latest Browse all 215

C# Parent-SubClass set inherited properties help

$
0
0
So I'm struggling to grasp this whole get; set; properties thing. Specifically, public class Gun : MonoBehaviour { public string gunName { get; set; } //"BLANK"; public string UID { get; set; } //"000AAA000AAA"; public string weaponType { get; set; } //"BLANK"; } Is my parent public class M9 : Gun { public string gunName = "M9"; public string UID = "00AA00AA"; public string weaponType = "HandGun"; } Is the child. I'm trying to set the properties in my main Gun class and specify those properties' values in any child classes. I've tried so many things, and I can't get it right. If I wasn't clear on my issue please ask! Thanks!

Viewing all articles
Browse latest Browse all 215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>