/// <summary> /// Calls character updated and/or created events. /// </summary> public void FireUpdatedEvent(bool cancelled) { this.cancelled = cancelled; if (!this.cancelled && !isOfficiallyCreated) { isOfficiallyCreated = true; if (CharacterCreated != null) { CharacterCreated.Invoke(this); } } if (CharacterUpdated != null) { CharacterUpdated.Invoke(this); } dirty = false; }
void OnDestroy() { if (isOfficiallyCreated) { if (CharacterDestroyed != null) { CharacterDestroyed.Invoke(this); } isOfficiallyCreated = false; } if (umaRoot != null) { CleanTextures(); CleanMesh(true); CleanAvatar(); Destroy(umaRoot); } }
void OnDestroy() { if (isOfficiallyCreated) { if (CharacterDestroyed != null) { CharacterDestroyed.Invoke(this); } isOfficiallyCreated = false; } if (_hasUpdatedBefore) { cleanTextures(); if (!onQuit) { cleanMesh(true); cleanAvatar(); } } }