コード例 #1
0
 public void TriggerBoatPieceObtained(BoatPiece _boatPiece)
 {
     if (OnBoatPieceObtained != null)
     {
         OnBoatPieceObtained(_boatPiece);
     }
 }
コード例 #2
0
    public void OnBoatProgressChange(BoatPiece _boatPiece)
    {
        if (!m_currentViewedStats)
        {
            return;
        }

        if (_boatPiece == BoatPiece.BASE)
        {
            StartCoroutine(DelayedHelperText("Press <sprite=3> to get into your boat!"));

            if (!m_currentViewedStats.BoatTiller && (!m_currentViewedStats.BoatMast || !m_currentViewedStats.BoatSail))
            {
                StartCoroutine(DelayedHelperText("missing some sort of engine though...", 3.8f));
            }
        }

        else if (m_currentViewedStats.BoatBase)
        {
            if (_boatPiece == BoatPiece.TILLER && (!m_currentViewedStats.BoatMast || !m_currentViewedStats.BoatSail))
            {
                StartCoroutine(DelayedHelperText("You now have control over the boat!"));
            }

            else if ((_boatPiece == BoatPiece.MAST || _boatPiece == BoatPiece.SAIL) && m_currentViewedStats.BoatBase &&
                     m_currentViewedStats.BoatMast && m_currentViewedStats.BoatSail && !m_currentViewedStats.BoatTiller)
            {
                StartCoroutine(DelayedHelperText("You now have control over the boat!"));
            }

            else if (m_currentViewedStats.BoatBase == m_currentViewedStats.BoatMast && m_currentViewedStats.BoatMast == m_currentViewedStats.BoatSail &&
                     m_currentViewedStats.BoatSail == m_currentViewedStats.BoatTiller && m_currentViewedStats.BoatTiller)
            {
                StartCoroutine(DelayedHelperText("Your boat has been upgraded!"));
            }
        }

        // If got all pieces, tell new objective
        if (m_currentViewedStats.BoatBase && m_currentViewedStats.BoatMast && m_currentViewedStats.BoatSail && m_currentViewedStats.BoatTiller)
        {
            Invoke("NewObjectiveText", 4.0f);
        }

        UpdateBoatUI();
    }