示例#1
0
 public PlayerShipModel(
     DefinitionsData definitions,
     Rigidbody2D rigidBody,
     PlayerInputState inputState)
 {
     this.rigidBody   = rigidBody;
     this.definitions = definitions;
     this.inputState  = inputState;
 }
示例#2
0
        public GameStateManager(UserData userData, DefinitionsData definitions, Settings settings)
        {
            this.userData    = userData;
            this.definitions = definitions;
            this.settings    = settings;

            gameState = new StateMachineSimple();
            gameState.MapState(StateInitialize);

            gameState.SwitchToState(StateInitialize);
        }
示例#3
0
        public override void InstallBindings()
        {
            DefinitionsData defData = new DefinitionsData();

            DefinitionsLoader.LoadDefinitions(defData);

            Container.Bind <DefinitionsData>().FromInstance(defData).AsSingle();

            Container.Bind <GameStateManager>().AsSingle().NonLazy();
            //load the user data from somewhere
            Container.Bind <UserData>().AsSingle().NonLazy();
        }
示例#4
0
        public static void LoadDefinitions(DefinitionsData definitionData)
        {
            TextAsset blockText = Resources.Load <TextAsset>("Definitions/Ships");

            definitionData.ShipDefinitions = JsonReader.Deserialize <ShipDefinition[]>(blockText.text);
        }