Example #1
0
        private void Start()
        {
            audioManager = GameObject.Find("Manager")
                           .GetComponent <AudioManager>();
            objRigidbody = GetComponent <Rigidbody>();
            sonicObject  = GetComponent <ModalSonicObject>();
            modalMesh    = GetComponent <ModalMesh>();

            kinematicUtil = GetComponent <IKinematicParameters>();

            audioManager.GetLoopSamplesForAudioClip(
                frictionLoop, out float[] audioLoop
                );

            softImpact = new SoftImpactForce(audioManager.SampleRate);
            friction   = new FrictionForce(audioLoop, audioManager.SampleRate);

            contactPoints = new ContactPoint[MAXCP];

            sonicObject.ImpactForceModel   = softImpact;
            sonicObject.FrictionForceModel = friction;

            // Basically turn of all audio from the
            // friction generator
            friction.SetLevel(-80.0f);

            // Stupid flag to prevent unity
            // from executing the collision callbacks
            // before initialization is done
            ready = true;
        }
Example #2
0
        private float[] yt_2;  // ^^

        private void SetupModel()
        {
            ModalManager modalManager = GameObject
                                        .Find("Manager")
                                        .GetComponent <ModalManager>();

            ModalMesh modalMesh = GetComponent <ModalMesh>();

            Model = modalManager.GetModalModel(modalMesh.MeshData);
        }