public T Initialize <T>(GameObject characterGO, ICharacterInstanceData instanceData) where T : GameCharacter { var character = characterGO.GetOrCreate <T>(); character.SetupData(instanceData, _gameInjector); character.EarlyInitialization(_gameInjector); Task.WaitAll(character.StartGame(_gameInjector)); character.gameObject.SetActive(true); return(character); }
public T Spawn <T>(T prefab, ICharacterInstanceData instanceData = null) where T : GameCharacter { var character = Object.Instantiate(prefab); character.SetupData(instanceData, _gameInjector); character.EarlyInitialization(_gameInjector); Task.WaitAll(character.StartGame(_gameInjector)); character.gameObject.SetActive(true); return(character); }
public abstract void SetupData(ICharacterInstanceData data, IServicesInjector gamePlayInjector);