コード例 #1
0
        private float 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.
            plane = GetComponent<AeroplaneController>();

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

            // Assign clips to the audiosources.
            engineSoundSource.clip = engineSound;
            windSoundSource.clip = windSound;

            // Set the parameters of the audiosources.
            engineSoundSource.minDistance = advanced.engineMinDistance;
            engineSoundSource.maxDistance = advanced.engineMaxDistance;
            engineSoundSource.loop = true;
            engineSoundSource.dopplerLevel = advanced.engineDopplerLevel;

            windSoundSource.minDistance = advanced.windMinDistance;
            windSoundSource.maxDistance = advanced.windMaxDistance;
            windSoundSource.loop = true;
            windSoundSource.dopplerLevel = advanced.windDopplerLevel;

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

            // Start the sounds playing.
            engineSoundSource.Play();
            windSoundSource.Play();
        }
コード例 #2
0
ファイル: AeroplaneAudio.cs プロジェクト: dvsource/TET_Craft
        private void Awake()
        {
            // Set up the reference to the aeroplane controller.
            m_Plane     = GetComponent <AeroplaneController>();
            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_WindSoundSource.minDistance  = m_AdvancedSetttings.windMinDistance;
            m_WindSoundSource.maxDistance  = m_AdvancedSetttings.windMaxDistance;
            m_WindSoundSource.loop         = true;
            m_WindSoundSource.dopplerLevel = m_AdvancedSetttings.windDopplerLevel;

            // 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();
        }
コード例 #3
0
ファイル: AeroplaneAiControl.cs プロジェクト: 0ptaq0/Corba-2D
        private bool takenOff;                                        // Has the plane taken off yet


        // setup script properties
        private void Awake()
        {
            // get the reference to the aeroplane controller, so we can send move input to it and read its current state.
            aeroplaneController = GetComponent <AeroplaneController>();

            // pick a random perlin starting point for lateral wandering
            randomPerlin = Random.Range(0f, 100f);
        }
コード例 #4
0
        private bool takenOff; // Has the plane taken off yet


        // setup script properties
        private void Awake()
        {
            // get the reference to the aeroplane controller, so we can send move input to it and read its current state.
            aeroplaneController = GetComponent<AeroplaneController>();

            // pick a random perlin starting point for lateral wandering
            randomPerlin = Random.Range(0f, 100f);
        }
コード例 #5
0
        private const float RpmToDps   = 60f;                                    // For converting from revs per minute to degrees per second.


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

            // Set the propellor blur gameobject's parent to be the propellor.
            propellorBlur.parent = propellorModel;
        }
コード例 #6
0
        private float throttleBlurStart = 0.25f; // The point at which the blurred textures start.

        #endregion Fields

        #region Methods

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

            // Set the propellor blur gameobject's parent to be the propellor.
            propellorBlur.parent = propellorModel;
        }
コード例 #7
0
        private AeroplaneController plane; // Reference to the aeroplane controller.

        private void Start()
        {
            // Get the reference to the aeroplane controller.
            plane = GetComponent<AeroplaneController>();

            // Store the original local rotation of each surface, so we can rotate relative to this
            foreach (var surface in controlSurfaces)
            {
                surface.originalLocalRotation = surface.transform.localRotation;
            }
        }
コード例 #8
0
        private AeroplaneController m_Plane;                         // Reference to the aeroplane controller.


        private void Start()
        {
            // Get the reference to the aeroplane controller.
            m_Plane = GetComponent <AeroplaneController>();

            // Store the original local rotation of each surface, so we can rotate relative to this
            foreach (var surface in m_ControlSurfaces)
            {
                surface.originalLocalRotation = surface.transform.localRotation;
            }
        }
コード例 #9
0
        // Use this for initialization
        private void Start()
        {
            // get the aeroplane from the object hierarchy
            m_Jet = FindAeroplaneParent();

            // get the particle system ( it will be on the object as we have a require component set up
            m_System = GetComponent<ParticleSystem>();

            // set the original properties from the particle system
            m_OriginalLifetime = m_System.startLifetime;
            m_OriginalStartSize = m_System.startSize;
            m_OriginalStartColor = m_System.startColor;
        }
コード例 #10
0
        private Color m_OriginalStartColor; // The original starting colout of the particle system

        // Use this for initialization
        private void Start()
        {
            // get the aeroplane from the object hierarchy
            m_Jet = FindAeroplaneParent();

            // get the particle system ( it will be on the object as we have a require component set up
            m_System = GetComponent <ParticleSystem>();

            // set the original properties from the particle system
            m_OriginalLifetime   = m_System.startLifetime;
            m_OriginalStartSize  = m_System.startSize;
            m_OriginalStartColor = m_System.startColor;
        }
コード例 #11
0
        // setup script properties
        private void Awake()
        {
            // get the reference to the aeroplane controller, so we can send move input to it and read its current state.
            m_AeroplaneController = GetComponent <AeroplaneController>();

            // pick a random perlin starting point for lateral wandering
            m_RandomPerlin = Random.Range(0f, 100f);

            _Camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();

            _EyeTarget = GameObject.FindGameObjectWithTag("waypoint");
            SetTarget(_EyeTarget.transform);

            //init call back queue
            _CallbackQueue = new Queue <Callback>();

            //register for gaze updates
            GazeManager.Instance.AddGazeListener(this);

#if !UNITY_EDITOR
            //hide waypoint if not in editor
            _EyeTarget.GetComponent <MeshRenderer>().enabled = false;
#endif
        }
コード例 #12
0
ファイル: LandingGear.cs プロジェクト: fafase/Catharsis
 // Use this for initialization
 private void Start()
 {
     plane = GetComponent<AeroplaneController>();
     animator = GetComponent<Animator>();
 }
コード例 #13
0
 private void Awake()
 {
     // Set up the reference to the aeroplane controller.
     aeroplane = GetComponent<AeroplaneController>();
 }
コード例 #14
0
 private void Awake()
 {
     // Set up the reference to the aeroplane controller.
     aeroplane = GetComponent <AeroplaneController>();
 }
コード例 #15
0
 // Use this for initialization
 private void Start()
 {
     m_Plane     = GetComponent <AeroplaneController>();
     m_Animator  = GetComponent <Animator>();
     m_Rigidbody = GetComponent <Rigidbody>();
 }
コード例 #16
0
        // setup script properties
        private void Awake()
        {
            // get the reference to the aeroplane controller, so we can send move input to it and read its current state.
            m_AeroplaneController = GetComponent<AeroplaneController>();

            // pick a random perlin starting point for lateral wandering
            m_RandomPerlin = Random.Range(0f, 100f);

            _Camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();

            _EyeTarget = GameObject.FindGameObjectWithTag("waypoint");
            SetTarget(_EyeTarget.transform);

            //init call back queue
            _CallbackQueue = new Queue<Callback>();

            //register for gaze updates
            GazeManager.Instance.AddGazeListener(this);

            #if !UNITY_EDITOR
            //hide waypoint if not in editor
            _EyeTarget.GetComponent<MeshRenderer>().enabled = false;
            #endif
        }
コード例 #17
0
 // Use this for initialization
 private void Start()
 {
     plane    = GetComponent <AeroplaneController>();
     animator = GetComponent <Animator>();
 }