public void DestroySaber() { CurrentModelComposition?.DestroyAdditionalInstances(); CurrentSaber?.Destroy(); CurrentSaber = null; CurrentPiece = null; }
public SaberInstance CreateSaber(SaberModel model, Transform parent, bool raiseSaberEvent = false, bool raisePieceEvent = false) { CurrentSaber = _saberFactory.Create(model); CurrentSaber.SetParent(parent); if (raiseSaberEvent) { OnSaberInstanceCreated?.Invoke(CurrentSaber); } CurrentPiece = GetPiece(SelectedDefinition); if (raisePieceEvent && CurrentPiece != null) { OnPieceInstanceCreated?.Invoke(CurrentPiece); } return(CurrentSaber); }