Пример #1
0
    public void OnTargetHpChanged(int newHP)
    {
        if (m_target.type != ETargetType.OBJECT)
        {
            return;
        }

        Objects.InteractableObject target = m_target.interactableTarget;

        if (target.GetComponent <Objects.InteractableBoatObject>())
        {
            if (newHP == target.m_hpMax)
            {
                ClearTarget();
            }
        }

        if (newHP == 0)
        {
            if (target.GetComponent <Objects.InteractableFire>() || target.GetComponent <Objects.InteractableResource>())
            {
                ClearTarget();
            }
        }
    }
Пример #2
0
    private void PlayRightAnimation()
    {
        if (m_target.type == ETargetType.OBJECT)
        {
            Objects.InteractableObject target = m_target.interactableTarget;

            if (target.GetComponent <Objects.InteractableCannon>())
            {
                if (target.m_hp != target.m_hpMax)
                {
                    PlayAnimation(Crew.CrewController.AnimationType.E_REPAIRING);
                }
                else
                {
                    PlayAnimation(Crew.CrewController.AnimationType.E_INTERACTING);
                }
            }
            else if (target.GetComponent <Objects.InteractableBoatObject>())
            {
                if (target.m_hp != target.m_hpMax)
                {
                    PlayAnimation(Crew.CrewController.AnimationType.E_REPAIRING);
                }
                else
                {
                    PlayAnimation(Crew.CrewController.AnimationType.E_NONE);
                }
            }
            else if (target.GetComponent <Objects.InteractableFire>())
            {
                PlayAnimation(Crew.CrewController.AnimationType.E_PIPIYING);
            }
            else if (target.GetComponent <Objects.InteractableResource>())
            {
                PlayAnimation(Crew.CrewController.AnimationType.E_INTERACTING);
            }
        }
    }