Ejemplo n.º 1
0
 private void InstallDIContainer()
 {
     // initialise the di container and installers
     container = new DiContainer();
     CoreServicesInstaller.Install(container);
     GameServiceInstaller.Install(container);
     GameSystemInstaller.Install(container);
 }
Ejemplo n.º 2
0
    public void SpawnSingleObject()
    {
        if (!string.IsNullOrEmpty(_objectId))
        {
            var commandSystem = GameSystemInstaller.Resolve <CommandSystem>();
            var gridService   = GameServiceInstaller.Resolve <GridService>();

            var command = new CommandData();
            command.type   = Constants.COMMAND_SPAWN_OBJ;
            command.output = _objectId;
            command.count  = 1;

            var cell = gridService.GetClosestCell(Vector3.zero, true);
            if (cell != null)
            {
                commandSystem.Execute(command, cell.position, cell);
            }
        }
    }