public override void ActionIn()
        {
            float      screenX = _playerController.playerInputState.X;
            float      screenY = _playerController.playerInputState.Y;
            RaycastHit hit;
            Ray        ray = CameraManager.Instance.CurCamera.followCamera.ScreenPointToRay(new Vector3(screenX, screenY, 0));

            bool IsHit = Physics.Raycast(ray.origin, ray.direction, out hit, rayDistance, maskLayer);

            if (IsHit && Vector3.Distance(_playerController.transform.position, hit.point)
                < distance)
            {
                GOMonsterController controller = hit.collider.GetComponent <GOMonsterController>();
                if (controller == null)
                {
                    return;
                }
                GameObject       obj  = controller.gameObject;
                MonsterBreedData data = DataManagerM.Instance.getMonsterDataManager().getBreedDate(obj);
                if (data.breedItem != _playerController.playerAttribute.handMaterialId)
                {
                    return;
                }
                controller.BeFeed();
            }
        }
Beispiel #2
0
 public MonsterState(GOMonsterController controller)
     : base(controller)
 {
 }