コード例 #1
0
ファイル: PlanetSurface.cs プロジェクト: aintech/Brooks_Star
 private void initFromVars()
 {
     statusScreen.initFromVars();
     if (Vars.planetType.isColonized())
     {
         market.buyMarket.initFromVars();
     }
 }
コード例 #2
0
ファイル: StarSystem.cs プロジェクト: aintech/Brooks_Star
    private void init()
    {
        Vars.initVars();
        Vars.inSpace = true;

        ItemFactory.itemPrefab = itemPrefab;
        mainCamera             = Camera.main.transform;

        Imager.initialize();
        Player.init();

        GameObject.Find("Images Provider").GetComponent <ImagesProvider>().init();

        starField = GameObject.Find("StarField").GetComponent <StarField>().init();
        star      = transform.Find("Star").GetComponent <SpriteRenderer>();
        star.gameObject.SetActive(true);

        ItemDescriptor descriptor = GameObject.Find("Item Descriptor").GetComponent <ItemDescriptor>().init();

        statusScreen = GameObject.Find("Status Screen").GetComponent <StatusScreen>().init(this, descriptor);

        descriptor.playerData = statusScreen.playerData;

        if (Vars.shipCurrentHealth == -1)
        {
            statusScreen.shipData.initializeRandomShip(HullType.ARMAGEDDON);
            statusScreen.inventory.setCapacity(statusScreen.shipData.hullType.getStorageCapacity());
        }
        else
        {
            statusScreen.initFromVars();
        }

        initPlayerShip();

        statusScreen.cameraController = cameraController;

        Vars.userInterface = GameObject.FindGameObjectWithTag("UserInterface").GetComponent <UserInterface>().init(statusScreen, this, playerShip);

        shieldsPool = GameObject.Find("ShieldsPool").GetComponent <ShieldsPool>();

        explosionsManager = GameObject.Find("Explosions Manager").GetComponent <ExplosionsManager>().init();

        lootDropper = GameObject.Find("Loot Dropper").GetComponent <LootDropper>().init(statusScreen.inventory, descriptor);

        spawner = GetComponent <EnemySpawner>().init(Vars.userInterface.minimap, playerShip.transform);

        loadStarSystem();

        gamePaused = false;
    }