void Update() { if (mIsInitialized) { return; } bool isValidOTTileMap = IsValidOTTileMap(); if (isValidOTTileMap) { Component tileMapObject = this.GetComponent("OTTileMap"); AddCollidersToOTTileMap(this.transform, tileMapObject); ComponentMenu2SelectAlphaMeshColliderChildren.SelectChildAlphaMeshColliders(Selection.gameObjects); } else { Debug.LogError("Not a valid OTTileMap object."); } DestroyImmediate(this, false); // note: we don't want this to be part of the undo mIsInitialized = true; }
void Update() { if (mIsInitialized) { return; } bool isValidBoneAnimation = IsValidBoneAnimation(); if (isValidBoneAnimation) { int undoGroupIndex = Undo.GetCurrentGroup(); UndoAware.BeginUndoGroup("Add AlphaMeshColliders"); AddCollidersToBoneAnimationTree(this.transform); ComponentMenu2SelectAlphaMeshColliderChildren.SelectChildAlphaMeshColliders(Selection.gameObjects); UndoAware.EndUndoGroup(); Undo.CollapseUndoOperations(undoGroupIndex); } else { Debug.LogError("Not a valid SmoothMoves BoneAnimation object."); } DestroyImmediate(this, false); // note: we don't want this to be part of the undo. mIsInitialized = true; }