// should only return true when a non aliased obj is loaded with scene // if we instntiate objects we should set guids manually bool NeedsID() { bool idIsEmpty = string.IsNullOrEmpty(id); if (usesAlias && idIsEmpty) { id = DynamicObjectManager.Alias2ID(aliasUsed); } return(idIsEmpty); }
static void _StartNewGame() { startingNewGame = true; DestroyPlayer(); // Debug.Log("On New Game Start Event"); if (onNewGameStart != null) { onNewGameStart(); } // Debug.Log("Loading New Game Scene"); DynamicObjectManager.MovePlayer(settings.newGameLocation, true); startingNewGame = false; }
void OnDisable() { // dont disable loaded version (since it's happening anyways) DynamicObjectManager.RemoveObjectByGUID(id, false, false); id = null; if (!_isPlayer) { activeInstances.Remove(this); } if (_isPlayer) { if (playerObject != null && playerObject == this) { playerObject = null; } } }
public static T GetAvailableInstance(PrefabReference prefabRef, Vector3 position, Quaternion rotation) { return(DynamicObjectManager.GetAvailableInstance <T>(prefabRef, position, rotation, null, true, true, false)); }