Quantcast
Channel: Answers for "Best practice for passing data between classes in C#"
Viewing all articles
Browse latest Browse all 6

Answer by Christian Stewart

$
0
0
Hi, What I recommend (from someone who is dealing with hundreds of dlls and classes) - make a static "instance" of each item (public static CharacterAnimator Instance) so you can access it from anywhere without bothering to use getComponent all the time. Next I recommend using properties. You mention them above, however I'm unsure wether or not you're using this format: public Vector3 movement { get; set; } If you use that format you can easily write in methods to be run when the variable is called later on. In terms of the "web" of references, this is "just the way it goes". Just be sure to remember what each method does with good commenting, and use a program like Visual Studio 2011 with the ReSharper plugin to ensure that all your code is in good form. Feel free to edit with more suggestions! ~Christian

Viewing all articles
Browse latest Browse all 6

Trending Articles



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