コード例 #1
0
    void OnGUI()
    {
        string msg = "Press [Space] to cycle timescale (Current value: " + Time.timeScale.ToString("0.0") + ")";

        if (m_lastProjectile)
        {
            msg += "\nTargetSpeedAtTimeOfCalculation: " + m_targetSpeedAtTimeOfCalculation.ToString();
            msg += "\nProjectileSpeedAtTimeOfCalculation: " + m_projectileSpeedAtTimeOfCalculation.ToString();
            msg += "\nLastPredictionFoundValidSolution: " + m_lastPredictionFoundValidSolution.ToString();
        }
        else
        {
            msg += "\nAccumulatedTime: " + m_accumulatedTime.ToString();
        }
        GUI.color = Color.black;
        GUI.Label(s_infoRectShadow, msg);
        GUI.color = Color.white;
        GUI.Label(s_infoRect, msg);

        Camera mainCam = Camera.main;

        msg = "bulletStartPos";
        DebuggingUtils.DrawTextInWorld(mainCam, bulletStartPos, msg, Color.red);

        if (m_lastProjectile)
        {
            msg  = "lastProjectile";
            msg += "\nProjectileRigidBodySpeed: " + m_lastProjectile.velocity.magnitude.ToString();
            msg += "\nProjectileMeasuredSpeed: " + m_measuredProjectileSpeed.ToString();
            DebuggingUtils.DrawTextInWorld(mainCam, m_lastProjectile.transform.position, msg, Color.red);
        }
    }
コード例 #2
0
    //////////////////////////////////////////////////////////////////////////////
    void OnGUI()
    {
        Camera mainCam = Camera.main;
        string msg     = "targetPos";

        msg += "\nTargetRigidBodySpeed: " + GetComponent <Rigidbody>().velocity.magnitude.ToString();
        msg += "\nTargetMeasuredSpeed: " + m_measuredSpeed.ToString();
        msg += "\nLastHitRigidBody: ";
        if (m_nameOfLastHitRigidBody.Length > 0)
        {
            msg += m_nameOfLastHitRigidBody;
        }
        else
        {
            msg += "None";
        }
        DebuggingUtils.DrawTextInWorld(mainCam, transform.position, msg, Color.blue);
    }