Ejemplo n.º 1
0
    public override void Init()
    {
        _inventory          = new Inventory(15);
        _quickslotInventory = new QuickSlotInventory(5);

        _itemDropper = GetComponent <ItemDropper>();

        var index = _quickslotInventory.ConvertQuickSlotIDToIndex(QuickSlotInventory.ID.Center);

        _quickslotInventory.SetInventoryItem(index, _holdItem.GetInstance(1));

        base.Init();
    }
Ejemplo n.º 2
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);
    }