1
PlayMaker Help / "Get Owner" Command in C#?
« on: November 09, 2012, 08:35:01 AM »
Disclaimer: This is regarding taking some functionality from Playmaker and trying to do it in code (C#)
I am trying to emulate the Get Owner command in C# - my use case is as follows : The player uses a resource node, which upon being used does a "Get Owner" and stores its gameObject as a Global PM Variable: UsedResource - it then sends a message back to the player telling it to open a menu with a progress bar. When the progress bar is finished it sends a message back to UsedResource telling it to destroy itself.
This works fine in playmaker, but for various reasons I want to figure out how to do this in code. Chiefly, I want to identify an instance of a prefab so I can specifically message it back later. Also I'd like this to eventually be multiplayer friendly - so I've heard using static variables is not a good idea?
Any help appreciated, thanks
I am trying to emulate the Get Owner command in C# - my use case is as follows : The player uses a resource node, which upon being used does a "Get Owner" and stores its gameObject as a Global PM Variable: UsedResource - it then sends a message back to the player telling it to open a menu with a progress bar. When the progress bar is finished it sends a message back to UsedResource telling it to destroy itself.
This works fine in playmaker, but for various reasons I want to figure out how to do this in code. Chiefly, I want to identify an instance of a prefab so I can specifically message it back later. Also I'd like this to eventually be multiplayer friendly - so I've heard using static variables is not a good idea?
Any help appreciated, thanks