Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main : MonoBehaviour {
- //some public and private variables...
- private OtherClass OtherGameLogic = new OtherClass(this);
- void Start () {
- //some initialisation happening
- }
- void Update () {
- // all complex frame to frame calculations are done here.
- // this is gpu and cpu intensive code...
- }
- }
- public class OtherClass
- {
- private Main M;
- public OtherClass(Main m)
- {
- M = m;
- }
- private void SomeMethod()
- {
- m.SomeFunctionThatNeedsMToRun();
- }
- }
Add Comment
Please, Sign In to add comment