コード例 #1
0
ファイル: GameEngine.cs プロジェクト: Treahall/WPFGame
 public GameEngine()
 {
     user           = new Player();
     menuCreator    = new MenuCreator(user);
     dungeonCreator = new DungeonCreator(user);
     RandomEnemy    = new RandomEnemyCreator(user);
 }
コード例 #2
0
ファイル: World.cs プロジェクト: futscdav/electric-cars-game
 public void Init()
 {
     time          = gameObject.AddComponent <Daytime>();
     powerStations = new List <PowerStation>();
     parkingSpots  = new List <ParkingSpace>();
     creator       = gameObject.AddComponent <WorldCreator>();
     creator.world = this;
 }
コード例 #3
0
 public static WorldCreator Instance(string _worldName = "")
 {
     if (instance == null)
     {
         instance = new WorldCreator(_worldName);
     }
     return(instance);
 }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: WorldSettings.cs プロジェクト: Kryod/drl
        private void OnCreateClicked()
        {
            WorldCreator creator = this.spawnedSettings.GetComponent <WorldCreator>();

            if (creator != null)
            {
                creator.CreateWorld();
            }
        }
コード例 #6
0
        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();
        }
コード例 #7
0
 //初期化処理
 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();
     }
 }
コード例 #8
0
        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();
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
 void Awake()
 {
     _world        = new World();
     _questSolver  = new QuestItemSolver();
     _worldCreator = FindObjectOfType <WorldCreator>();
 }
コード例 #12
0
ファイル: ScWizard.cs プロジェクト: charder/GameAIUnity
    public void softReset()
    {
        if (world != null) {
            world.cleanUpGraph ();
        }
        world = new WorldCreator ();
        world.createWorld ("hrt201n");

        placeWorldCharacters ();
    }
コード例 #13
0
ファイル: World.cs プロジェクト: pontura/mundo
 void Start()
 {
     creator = GetComponent <WorldCreator>();
 }
コード例 #14
0
ファイル: Level01.cs プロジェクト: PhilipBui/Blocked
    void Start()
    {
        WorldCreator worldCreatorScript = GameObject.FindGameObjectWithTag("WorldCreator").GetComponent <WorldCreator>();

        worldCreatorScript.loadLevel(level01);
    }
コード例 #15
0
 void Awake()
 {
     worldCreator = GetComponent <WorldCreator>();
 }
コード例 #16
0
ファイル: WorldCreator.cs プロジェクト: johnjoemcbob/Heck
 private void Awake()
 {
     Instance = this;
 }
コード例 #17
0
 public void Setup(PlayController playController)
 {
     Stage   = playController;
     creator = new WorldCreator();
     creator.Setup(this, Stage);
 }
コード例 #18
0
 void Start()
 {
     worldCreator = FindObjectOfType <WorldCreator>();
     CreateObstacle();
 }