|
Awake() is called when a script is being loaded. Is there a similar method for when a script is being unloaded or disabled? Or some other way that your script can know it's being unloaded? Should I just use a destructor?
(comments are locked)
|
|
There's MonoBehavior.OnDestroy() http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnDestroy.html Duh! Awake() and Start() don't begin with "On", so I just glanced over all of the methods that begin with "On" in the documentation. Guess I should have been a little more careful. =P
Jul 05 '12 at 06:22 PM
Moohasha
(comments are locked)
|
|
You can also use OnDisable and OnEnable for information about an object being enabled and disabled in addition to OnDestroy().
(comments are locked)
|
