Exemplo n.º 1
0
            private void OnMouseDown(Vector3 position)
            {
                Ray ray = Mediator._camera.ScreenPointToRay(position);

                RaycastHit hit;

                if (Physics.Raycast(ray, out hit))
                {
                    Mediator._destination = hit.point;

                    Mediator.CalculateSpeedAndMove();
                }
            }
Exemplo n.º 2
0
            public override void OnStateEnter()
            {
                base.OnStateEnter();

                View.OnMouseDownEvent += OnMouseDown;
                View.OnScroll         += OnScroll;

                Mediator._hero.OnAnimalEnter += OnAnimalEnter;
                Mediator._hero.OnAnimalExit  += OnAnimalExit;

                Mediator._hero.OnPenEnter += OnPenEnter;

                RemoteDataModel.HeroModel.SpeedBoost.Subscribe((s) =>
                {
                    if (s > 0)
                    {
                        Mediator.CalculateSpeedAndMove();
                    }
                })
                .AddTo(Disposables);
            }