Exemple #1
0
    private void PlayerActorOnOpenedContainer(object sender, OpenContainerEventArgs e)
    {
        var actor = sender as IActor;

        if (!(e.Result is SuccessOpenContainerResult))
        {
            Debug.Log($"Не удалось открыть контейнер {e.Container}.");
        }

        var props = e.Container.Content.CalcActualItems();

        if (props.Any())
        {
            var containerPopupObj = _container.InstantiatePrefab(ContainerPopupPrefab, WindowCanvas.transform);

            var containerPopup = containerPopupObj.GetComponent <ContainerPopup>();

            var transferMachine = new PropTransferMachine(actor.Person.Inventory, e.Container.Content);
            containerPopup.Init(transferMachine);
        }
        else
        {
            var indicator = Instantiate <FoundNothingIndicator>(FoundNothingIndicatorPrefab, transform);

            var actorViewModel = ActorViewModels.SingleOrDefault(x => x.Actor == actor);

            indicator.Init(actorViewModel);
        }
    }
Exemple #2
0
    private void Actor_OpenedContainer(object sender, OpenContainerEventArgs e)
    {
        var containerNode      = (HexNode)e.Container.Node;
        var worldPositionParts = HexHelper.ConvertToWorld(containerNode.OffsetX, containerNode.OffsetY);
        var targetPosition     = new Vector3(worldPositionParts[0], worldPositionParts[1] / 2, -1);

        GraphicRoot.ProcessInteractive(targetPosition);
    }
    private void PlayerActorOnOpenedContainer(object sender, OpenContainerEventArgs e)
    {
        if (!(e.Result is SuccessOpenContainerResult))
        {
            Debug.Log($"Не удалось открыть контейнер {e.Container}.");
        }

        _clientCommandExecutor.Push(_showContainerModalCommand);
    }
Exemple #4
0
    private void PlayerActorOnOpenedContainer(object sender, OpenContainerEventArgs e)
    {
        var actor = sender as IActor;

        if (!(e.Result is SuccessOpenContainerResult))
        {
            Debug.Log($"Не удалось открыть контейнер {e.Container}.");
        }

        var propContainer = e.Container.GetModule <IPropContainer>();

        ShowFoundPropsModalOrNotFound(actor, propContainer);
    }
Exemple #5
0
    private async void PlayerActorOnOpenedContainer(object sender, OpenContainerEventArgs e)
    {
        var actor = sender as IActor;

        if (!(e.Result is SuccessOpenContainerResult))
        {
            Debug.Log($"Не удалось открыть контейнер {e.Container}.");
        }

        await Task.Factory.StartNew(() =>
        {
            var propContainer = e.Container.GetModule <IPropContainer>();
            ShowFoundPropsModalOrNotFound(actor, propContainer);
        }, CancellationToken.None, TaskCreationOptions.None, _taskScheduler);
    }
Exemple #6
0
 private void Actor_OpenedContainer(object?sender, OpenContainerEventArgs e)
 {
     _containerModal.Init(e.Container);
     _containerModal.Show();
 }
Exemple #7
0
 private void PlayerActorOnOpenedContainer(object sender, OpenContainerEventArgs e)
 {
     _clientCommandExecutor.Push(_showContainerModalCommand);
 }