private void Awake()
    {
        // Set up the reference to the aeroplane controller.
        propellers = GetComponent <PropellersController>();

//        m_PropellorModelRenderer = m_PropellorModel.GetComponent<Renderer>();
//        m_PropellorBlurRenderer = m_PropellorBlur.GetComponent<Renderer>();

        // Set the propellor blur gameobject's parent to be the propellor.
//        m_PropellorBlur.parent = m_PropellorModel;
    }
    private PropellersController propellers; // Reference to the aeroplane controller.

    #endregion Fields

    #region Methods

    private void Awake()
    {
        // Set up the reference to the aeroplane controller.
        propellers = GetComponent<PropellersController>();

        //        m_PropellorModelRenderer = m_PropellorModel.GetComponent<Renderer>();
        //        m_PropellorBlurRenderer = m_PropellorBlur.GetComponent<Renderer>();

        // Set the propellor blur gameobject's parent to be the propellor.
        //        m_PropellorBlur.parent = m_PropellorModel;
    }
Beispiel #3
0
    void Start()
    {
        propellersController = GetComponent <PropellersController> ();
        rb           = GetComponent <Rigidbody>();
        m_PhotonView = GetComponent <PhotonView>();

        rb.inertiaTensor = new Vector3(12e-4f, 15e-4f, 10e-4f);

        LoadPlayerPrefs();
        resetYawRef();
        Dbg.Trace("phi, theta, psi, phi_ref, theta_ref, psi_ref, p, q, r, p_ref, q_ref, r_ref, torque_x, torque_y, torque_z, vz, vz_ref, thrust_Z");
    }
Beispiel #4
0
    private void Awake()
    {
        // Set up the reference to the aeroplane controller.
        m_Propellers = GetComponent <PropellersController>();
        m_Rigidbody  = GetComponent <Rigidbody>();


        // Add the audiosources and get the references.
        m_EngineSoundSource             = gameObject.AddComponent <AudioSource>();
        m_EngineSoundSource.playOnAwake = false;
        m_WindSoundSource             = gameObject.AddComponent <AudioSource>();
        m_WindSoundSource.playOnAwake = false;

        // Assign clips to the audiosources.
        m_EngineSoundSource.clip = m_EngineSound;
        m_WindSoundSource.clip   = m_WindSound;

        // Set the parameters of the audiosources.
        m_EngineSoundSource.minDistance  = m_AdvancedSetttings.engineMinDistance;
        m_EngineSoundSource.maxDistance  = m_AdvancedSetttings.engineMaxDistance;
        m_EngineSoundSource.loop         = true;
        m_EngineSoundSource.dopplerLevel = m_AdvancedSetttings.engineDopplerLevel;
        m_EngineSoundSource.spatialBlend = 1;
        m_EngineSoundSource.rolloffMode  = AudioRolloffMode.Logarithmic;
        m_EngineSoundSource.minDistance  = 10;
        m_EngineSoundSource.maxDistance  = 500;

        m_WindSoundSource.minDistance    = m_AdvancedSetttings.windMinDistance;
        m_WindSoundSource.maxDistance    = m_AdvancedSetttings.windMaxDistance;
        m_WindSoundSource.loop           = true;
        m_WindSoundSource.dopplerLevel   = m_AdvancedSetttings.windDopplerLevel;
        m_EngineSoundSource.spatialBlend = 1;
        m_EngineSoundSource.rolloffMode  = AudioRolloffMode.Logarithmic;
        m_EngineSoundSource.minDistance  = 20;
        m_EngineSoundSource.maxDistance  = 1000;

        // call update here to set the sounds pitch and volumes before they actually play
        Update();

        // Start the sounds playing.
        m_EngineSoundSource.Play();
        m_WindSoundSource.Play();
    }
Beispiel #5
0
    private float m_WindSpeedPitchFactor = 0.004f; // Relative increase in pitch of the wind from the plane's speed.

    #endregion Fields

    #region Methods

    private void Awake()
    {
        // Set up the reference to the aeroplane controller.
        m_Propellers = GetComponent<PropellersController>();
        m_Rigidbody = GetComponent<Rigidbody>();

        // Add the audiosources and get the references.
        m_EngineSoundSource = gameObject.AddComponent<AudioSource>();
        m_EngineSoundSource.playOnAwake = false;
        m_WindSoundSource = gameObject.AddComponent<AudioSource>();
        m_WindSoundSource.playOnAwake = false;

        // Assign clips to the audiosources.
        m_EngineSoundSource.clip = m_EngineSound;
        m_WindSoundSource.clip = m_WindSound;

        // Set the parameters of the audiosources.
        m_EngineSoundSource.minDistance = m_AdvancedSetttings.engineMinDistance;
        m_EngineSoundSource.maxDistance = m_AdvancedSetttings.engineMaxDistance;
        m_EngineSoundSource.loop = true;
        m_EngineSoundSource.dopplerLevel = m_AdvancedSetttings.engineDopplerLevel;
        m_EngineSoundSource.spatialBlend = 1;
        m_EngineSoundSource.rolloffMode = AudioRolloffMode.Logarithmic;
        m_EngineSoundSource.minDistance = 10;
        m_EngineSoundSource.maxDistance = 500;

        m_WindSoundSource.minDistance = m_AdvancedSetttings.windMinDistance;
        m_WindSoundSource.maxDistance = m_AdvancedSetttings.windMaxDistance;
        m_WindSoundSource.loop = true;
        m_WindSoundSource.dopplerLevel = m_AdvancedSetttings.windDopplerLevel;
        m_EngineSoundSource.spatialBlend = 1;
        m_EngineSoundSource.rolloffMode = AudioRolloffMode.Logarithmic;
        m_EngineSoundSource.minDistance = 20;
        m_EngineSoundSource.maxDistance = 1000;

        // call update here to set the sounds pitch and volumes before they actually play
        Update();

        // Start the sounds playing.
        m_EngineSoundSource.Play();
        m_WindSoundSource.Play();
    }
    void Start()
    {
        propellersController = GetComponent<PropellersController> ();
        rb = GetComponent<Rigidbody>();
        m_PhotonView = GetComponent<PhotonView>();

        rb.inertiaTensor = new Vector3(12e-4f, 15e-4f, 10e-4f);

        LoadPlayerPrefs ();
        resetYawRef ();
        Dbg.Trace ("phi, theta, psi, phi_ref, theta_ref, psi_ref, p, q, r, p_ref, q_ref, r_ref, torque_x, torque_y, torque_z, vz, vz_ref, thrust_Z");
    }