public GameEngine() { user = new Player(); menuCreator = new MenuCreator(user); dungeonCreator = new DungeonCreator(user); RandomEnemy = new RandomEnemyCreator(user); }
public void Init() { time = gameObject.AddComponent <Daytime>(); powerStations = new List <PowerStation>(); parkingSpots = new List <ParkingSpace>(); creator = gameObject.AddComponent <WorldCreator>(); creator.world = this; }
public static WorldCreator Instance(string _worldName = "") { if (instance == null) { instance = new WorldCreator(_worldName); } return(instance); }
public void Start() { ECS_ClientWorld = new World("ClientWorld"); var systems = WorldCreator.GetSystemsFromAssemblies(ECS_ClientWorld, "FNZ.Client", "FNZ.Shared"); var initializationSystemGroup = ECS_ClientWorld.GetOrCreateSystem <InitializationSystemGroup>(); var simulationSystemGroup = ECS_ClientWorld.GetOrCreateSystem <SimulationSystemGroup>(); var presentationSystemGroup = ECS_ClientWorld.GetOrCreateSystem <PresentationSystemGroup>(); foreach (var type in systems) { var groups = type.GetCustomAttributes(typeof(UpdateInGroupAttribute), true); if (groups.Length == 0) { simulationSystemGroup.AddSystemToUpdateList(WorldCreator.GetBehaviourManagerAndLogException(ECS_ClientWorld, type) as ComponentSystemBase); } foreach (var g in groups) { var group = g as UpdateInGroupAttribute; if (group == null) { continue; } if (!(typeof(ComponentSystemGroup)).IsAssignableFrom(group.GroupType)) { UnityEngine.Debug.LogError($"Invalid [UpdateInGroup] attribute for {type}: {group.GroupType} must be derived from ComponentSystemGroup."); continue; } var groupMgr = WorldCreator.GetBehaviourManagerAndLogException(ECS_ClientWorld, group.GroupType); if (groupMgr == null) { UnityEngine.Debug.LogWarning( $"Skipping creation of {type} due to errors creating the group {group.GroupType}. Fix these errors before continuing."); continue; } var groupSys = groupMgr as ComponentSystemGroup; if (groupSys != null) { groupSys.AddSystemToUpdateList(WorldCreator.GetBehaviourManagerAndLogException(ECS_ClientWorld, type) as ComponentSystemBase); } } } initializationSystemGroup.SortSystemUpdateList(); simulationSystemGroup.SortSystemUpdateList(); presentationSystemGroup.SortSystemUpdateList(); WorldCreator.UpdatePlayerLoop(ECS_ClientWorld); }
private void OnCreateClicked() { WorldCreator creator = this.spawnedSettings.GetComponent <WorldCreator>(); if (creator != null) { creator.CreateWorld(); } }
static public void Run() { Console.WriteLine("------------LazySingleton------------"); WorldCreator.Instance("Mario World"); WorldCreator.Instance().Create(); //The world name don't be changed WorldCreator.Instance("Yoshi's World"); WorldCreator.Instance().Create(); }
//初期化処理 public void Init() { if (GameStateManager.Instance.CurrentScene == 1) { WSetting = GameObject.FindGameObjectWithTag("WorldSetting").GetComponent <WorldSetting>(); worldID = "1"; } else if (GameStateManager.Instance.CurrentScene == 2) { WCreator = GameObject.FindGameObjectWithTag("ObjectSpawner").GetComponent <WorldCreator>(); Create(); } }
static public void Run() { Console.WriteLine("------------Singleton------------"); //Two way for use Singleton //1 WorldCreator worldCreator = WorldCreator.Instance("Mario World"); worldCreator.Create(); //2 WorldCreator.Instance("Mario World"); WorldCreator.Instance().Create(); //The world name don't be changed worldCreator = WorldCreator.Instance("Yoshi's World"); worldCreator.Create(); }
public void Start() { ECS_ServerWorld = new World("ServerWorld"); var systems = WorldCreator.GetSystemsFromAssemblies(ECS_ServerWorld, "FNZ.Server", "FNZ.Shared"); var initializationSystemGroup = ECS_ServerWorld.GetOrCreateSystem <InitializationSystemGroup>(); var simulationSystemGroup = ECS_ServerWorld.GetOrCreateSystem <SimulationSystemGroup>(); var presentationSystemGroup = ECS_ServerWorld.GetOrCreateSystem <PresentationSystemGroup>(); foreach (var type in systems) { var groups = type.GetCustomAttributes(typeof(UpdateInGroupAttribute), true); if (groups.Length == 0) { simulationSystemGroup.AddSystemToUpdateList(ECS_ServerWorld.GetOrCreateSystem(type) as ComponentSystemBase); } foreach (var g in groups) { var group = g as UpdateInGroupAttribute; if (group == null) { continue; } var groupMgr = ECS_ServerWorld.GetOrCreateSystem(group.GroupType); var groupSys = groupMgr as ComponentSystemGroup; if (groupSys != null) { groupSys.AddSystemToUpdateList(ECS_ServerWorld.GetOrCreateSystem(type) as ComponentSystemBase); } } } initializationSystemGroup.SortSystemUpdateList(); simulationSystemGroup.SortSystemUpdateList(); presentationSystemGroup.SortSystemUpdateList(); WorldCreator.UpdatePlayerLoop(ECS_ServerWorld); }
public MenuState() { screens.Add("main"); screens.Add("creation"); screens.Add("continue"); curScreen = screens[0]; options.Add("New Game"); //0 options.Add("Continue"); //1 options.Add("Options"); //2 options.Add("Exit Game"); //3 curOptionSelectionID = 0; this.worldCreator = new WorldCreator(); this.continueMenu = new ContinueMenu(); this.keyboardState = Keyboard.GetState(); this.mouseState = Mouse.GetState(); inputHandler = new InputHandler(this.keyboardState, this.mouseState); }
void Awake() { _world = new World(); _questSolver = new QuestItemSolver(); _worldCreator = FindObjectOfType <WorldCreator>(); }
public void softReset() { if (world != null) { world.cleanUpGraph (); } world = new WorldCreator (); world.createWorld ("hrt201n"); placeWorldCharacters (); }
void Start() { creator = GetComponent <WorldCreator>(); }
void Start() { WorldCreator worldCreatorScript = GameObject.FindGameObjectWithTag("WorldCreator").GetComponent <WorldCreator>(); worldCreatorScript.loadLevel(level01); }
void Awake() { worldCreator = GetComponent <WorldCreator>(); }
private void Awake() { Instance = this; }
public void Setup(PlayController playController) { Stage = playController; creator = new WorldCreator(); creator.Setup(this, Stage); }
void Start() { worldCreator = FindObjectOfType <WorldCreator>(); CreateObstacle(); }