Exemplo n.º 1
0
    // *********************************************

    public override void Init()
    {
        base.Init();

        CreateCameraTarget();
        CreateCameraFocus();
        CreateDataController();


        // load data
        _quickslotInventory = _dataController.LoadQuickSlotInventory();
        _inventory          = _dataController.LoadInventory();
        _gunParts           = _dataController.LoadPartInventory();


        // save when changes are made
        _quickslotInventory.OnInventoryItemChanged += (index, item) => {
            _dataController.SaveQuickSlotInventory(_quickslotInventory);
        };
        _inventory.OnInventoryItemChanged += (index, item) => {
            _dataController.SaveInventory(_inventory);
        };
        _gunParts.OnPartListChanged += () => {
            _dataController.SavePartInventory(_gunParts);
        };


        // set hand item
        _quickslotInventory.SetInventoryItem(_quickslotInventory.ConvertQuickSlotIDToIndex(QuickSlotInventory.ID.Center), _hand.GetInstance(1));


        // add input reciever
        Game.Input.AddReciever(

            new InputRecieverLayer(

                new List <IInputReciever>()
        {
            this,
            _interactor as PlayerInteractor,
            _brain as PlayerMovement
        }
                ),
            0);
    }