Ejemplo n.º 1
0
 private void OnTriggerExit(Collider other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         PlayerInteractionHandler handler = other.gameObject.GetComponent <PlayerInteractionHandler>();
         handler.LeaveInteractionArea();
     }
 }
Ejemplo n.º 2
0
 public override void InteractContinuously(PlayerInteractionHandler handler)
 {
     if (addedComponents.Count > 0)
     {
         base.InteractContinuously(handler);
         bool done = Construct();
         if (done)
         {
             handler.FinishContiniousInteraction();
         }
     }
 }
Ejemplo n.º 3
0
        public PlayerInteractionHandlerTests()
        {
            _sut = new PlayerInteractionHandler(
                _coordsParserMock.Object, _fleetSupervisorMock.Object, _boardManagerMock.Object);

            _boardCoordinates = _fixture.Create <BoardCoordinates>();
            _coordsParserMock.Setup(p => p.Parse(It.IsAny <string>()))
            .Returns(_boardCoordinates);
            _fleetSupervisorMock.SetupGet(f => f.FloatingShipsLeft).Returns(3);
            _boardManagerMock.Setup(m => m.IsLegalShot(It.IsAny <BoardCoordinates>()))
            .Returns(true);
        }
Ejemplo n.º 4
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag.Equals(tagToDetect))
        {
            #if UNITY_EDITOR
            Debug.Log("[Entity] hit: " + other.gameObject.name);
            #endif

            PlayerInteractionHandler interactionHandler = other.gameObject.GetComponentInChildren <PlayerInteractionHandler>();
            interactionHandler.OnPlayerHit?.Invoke();
            hitByTransform = null;
        }
    }
Ejemplo n.º 5
0
 public virtual void InteractOnce(PlayerInteractionHandler handler)
 {
 }
Ejemplo n.º 6
0
 public virtual void InteractContinuously(PlayerInteractionHandler handler)
 {
 }
Ejemplo n.º 7
0
 public override void InteractOnce(PlayerInteractionHandler handler)
 {
     base.InteractOnce(handler);
 }