Beispiel #1
0
    private void OnTriggerExit(Collider other)
    {
        if (m_currFishingSkillLevel == 0)
        {
            return;
        }
        if (m_fishingSignLayerMask == (m_fishingSignLayerMask | (1 << other.gameObject.layer)))
        {
            FishingSign sign = other.GetComponent <FishingSign>();
            if (sign == null)
            {
                Debug.LogError("Exited trigger of chracter who is not fish sign.");
                return;
            }

            if (m_currFishingSign != sign)
            {
                Debug.LogWarning("Exiting fish sign range that you weren't in range of.");
                sign.SetInteractable(false);
            }

            if (m_currFishingSign == null)
            {
                return;
            }

            m_currFishingSign.SetInteractable(false);
            m_fishingCamera   = null;
            m_currFishingSign = null;
        }
    }
Beispiel #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (m_currFishingSkillLevel == 0)
        {
            return;
        }
        if (m_fishingSignLayerMask == (m_fishingSignLayerMask | (1 << other.gameObject.layer)))
        {
            FishingSign sign = other.GetComponent <FishingSign>();
            if (sign == null)
            {
                Debug.LogError("Entered trigger of chracter who is not fishing sign.");
                return;
            }

            if (m_currFishingSign != null)
            {
                Debug.LogWarning("Overriding current fishing sign to talk to.");
                m_currFishingSign.SetInteractable(false);
            }

            // Check NodeExists
            if (!sign.Interactible)
            {
                m_fishingCamera   = null;
                m_currFishingSign = null;
                return;
            }

            m_currFishingSign = sign;
            m_fishingCamera   = m_currFishingSign.FishingCamera.GetComponent <CinemachineVirtualCamera>();
            m_currFishingSign.SetInteractable(true);
        }
    }