public MultiSceneAppearer(sceneAppearInfo[] appearInfo, AppearablePositionState state)
 {
     this.state     = state;
     sceneRenderers = new SingleSceneAppearer[appearInfo.Length];
     for (var i = 0; i < appearInfo.Length; i++)
     {
         sceneRenderers[i] = new SingleSceneAppearer(appearInfo[i], i, state);
     }
 }
Example #2
0
        public Ship makeShip(Fleet fleet, Vector3 position)
        {
            GameObject go;
            var        ship     = makeTransforms(out go, fleet);
            var        state    = makeState(ship, go.transform, fleet, position);
            var        renderer = new SingleSceneAppearer(new sceneAppearInfo(shipPrefabs[0]), 3, state.positionState);

            ship.Init(state, renderer);
            fleet.state.shipsContainer.addShips(ship);
            return(ship);
        }
Example #3
0
        public Ship makeShip(ShipState shipState, Fleet fleet)
        {
            GameObject go;
            var        ship = makeTransforms(out go, fleet);

            GameManager.idMaker.insertObject(ship, shipState.id);
            hydrateState(shipState, go.transform, fleet, ship);
            var renderer = new SingleSceneAppearer(new sceneAppearInfo(shipPrefabs[0]), 3, shipState.positionState);

            ship.Init(shipState, renderer);
            return(ship);
        }
 protected override bool _appearImplimentation(int scene)
 {
     this.activeScene = scene;
     if (state.isActive)
     {
         destroy();
     }
     currentAppearer = sceneRenderers[scene];
     if (currentAppearer != null)
     {
         state.isActive = currentAppearer.appear(scene);
     }
     return(state.isActive);
 }
Example #5
0
        public Planet makePlanet(StarNode star, Vector3 position, Faction faction)
        {
            var name = Names.planetNames.getName();

            Transform parent;
            var       planet   = makeTransforms(star, name, out parent);
            var       tileable = tileFactory.makeTileManager();

            var state      = makeState(parent, planet, position, star, name, faction, tileable.state);
            var appearable = new SingleSceneAppearer(new sceneAppearInfo(baseStarFab), 3, state.positionState);

            planet.Init(appearable, tileable, state);
            GameManager.instance.factions.registerPlanetToFaction(planet, faction);
            return(planet);
        }
Example #6
0
        public Planet makePlanet(Reference <Planet> Planetref, StarNode star, Dictionary <long, object> stateTable)
        {
            var       name    = Names.planetNames.getName();
            var       faction = GameManager.instance.user.faction;
            Transform parent;
            var       planet = makeTransforms(star, name, out parent);
            var       state  = (PlanetState)stateTable[Planetref.id];

            hydrateState(planet, star, state, parent, stateTable);
            var tileable = tileFactory.makeTileManager();

            var appearable = new SingleSceneAppearer(new sceneAppearInfo(baseStarFab), 3, state.positionState);

            planet.Init(appearable, tileable, state);
            return(planet);
        }
Example #7
0
        public ProtoStar createStar(Transform holder)
        {
            var go = new GameObject("protoNode");

            go.transform.SetParent(holder);
            var state = new ProtostarState()
            {
                appearableState = new State.AppearablePositionState(
                    appearTransform: go.transform,
                    position: new Vector3(1, 1, 1),
                    star: null
                    )
            };
            var mainAppearer = new SingleSceneAppearer(new sceneAppearInfo(_sceneToPrefab[0]), 0, state.appearableState);
            var rep          = new LinkedAppearer(mainAppearer, state);


            var star = new ProtoStar();

            star.init(rep, state);
            star.appearer.appear(0);
            return(star);
        }
Example #8
0
 public void Init(ShipState state, SingleSceneAppearer renderer)
 {
     this.state      = state;
     this.debugState = state;
     appearer        = renderer;
 }
Example #9
0
 public void Init(SingleSceneAppearer renderer, Tileable tileable, PlanetState state)
 {
     appearer      = renderer;
     this.state    = state;
     this.tileable = tileable;
 }