Пример #1
0
 public void OnEvent(CustomEventArgs messageData)
 {
     var message = messageData.Message;
     switch (message)
     {
         case GameEventName.TargetСapture: 
             ActivateCard();
             break;
         case GameEventName.NonTargetСapture:
             _draggableCard.OnEndDrag();
             break;
         case GameEventName.TargetingСapture:
             _targeting = messageData.Value as GameObject;
             _animaManager.SetStateAnimation(_targeting, "target", true);
             break;
         case GameEventName.NonTargetingСapture:
             if (_targeting != null)
             {
                 _animaManager.SetStateAnimation(_targeting, "target", false);
                 _targeting = null;
             }
             break;
         case GameEventName.TargetingPlayer:
             _targeting = messageData.Value as GameObject;
             _targetPlayer.transform.position = _targeting.transform.position;
             _targetPlayer.gameObject.GetComponent<RectTransform>().SetRectByAnchor(_defaultMaxTargetPlayer, _defaultMinTargetPlayer);
             _targetPlayer.SetActive(true);
             //_animaManager.SetStateAnimation(_targetIconPlayer, "target", true);
             break;
         case GameEventName.NonTargetingPlayer:
             //_animaManager.SetStateAnimation(_targetIconPlayer, "target", false);
             _targetPlayer.SetActive(false);
             break;
         case GameEventName.TargetingArea:
             _targeting = messageData.Value as GameObject;
             _targetPlayer.transform.position = _targeting.transform.position;
             _targetPlayer.GetComponent<RectTransform>().SetRectByParent(_targeting.gameObject.GetComponent<RectTransform>());
             _targetPlayer.SetActive(true);
             break;
         case GameEventName.NonTargetingArea:
             _targetPlayer.SetActive(false);
             break;
     }
 }