Пример #1
0
 public override void init(GameObject go, System.Object customPhysics, Inputs inputs)
 {
     base.init (go, customPhysics, inputs);
     soundManager.init (go);
     name = "Idle Mechanic";
     setupAnimation (idleAnimation, ref idleHash);
 }
Пример #2
0
 public override void init(GameObject go, System.Object customPhysics, Inputs inputs)
 {
     flightPhysics = (FlightPhysics)customPhysics;
     flightInputs = (FlightInputs)inputs;
     base.init (go);
     setupAnimation (bankingParameter, ref bankingHash);
 }
 public override void init(GameObject go, System.Object customPhysics, Inputs inputs)
 {
     groundInputs = (GroundInputs)inputs;
     base.init (go, customPhysics, inputs);
     soundManager.init (go);
     setupAnimation (launchingAnimation, ref launchingHash);
 }
Пример #4
0
 public override void init(GameObject go, System.Object customPhysics, Inputs inputs)
 {
     flightPhysics = (FlightPhysics)customPhysics;
     flightInputs = (FlightInputs)inputs;
     base.init (go);
     name = "Flaring Mechanic";
     setupAnimation (flaringAnimation, ref flaringHash);
 }
Пример #5
0
 public override void init(GameObject go, System.Object customPhysics, Inputs inputs)
 {
     groundInputs = (GroundInputs)inputs;
     base.init (go, customPhysics, inputs);
     soundManager.init (go);
     setupAnimation (walkingAnimation, ref walkingHash);
     setupAnimation (walkingSpeed, ref walkingSpeedHash);
     setupAnimation (angularSpeed, ref angularSpeedHash);
 }
Пример #6
0
 public override void init(GameObject go, System.Object customPhysics, Inputs inputs)
 {
     flightPhysics = (FlightPhysics)customPhysics;
     base.init (go);
     soundManager.init (go);
     mainMonbehaviour = gameObject.GetComponent<FreeFlight> ();
     setupAnimation (landingAnimation, ref landingHash);
     setupAnimation (crashingAnimation, ref crashingHash);
 }
Пример #7
0
        /// <summary>
        /// Do initialization for the modes mechanics. Mode Mechanics **MUST** be instantiated **ONLY** if they are null, 
        /// otherwise serialized data will be overwritten with default values. The same goes for inputs and physics.
        /// </summary>
        /// <param name="modeMechanics">Mode mechanics.</param>
        /// <param name="modeInputs">Mode inputs.</param>
        /// <param name="customPhysics">Custom physics.</param>
        public void setupMechanics(PolymorphicSerializer modeMechanics,Inputs modeInputs,System.Object customPhysics = null)
        {
            inputs = modeInputs;

            if (modeMechanics == null)
                throw new NullReferenceException ("Mode failed setupMechanics(): 'Mode mechanics' must be instantiated or " +
                    "deserialized before calling this method.");
            if (inputs == null)
                throw new NullReferenceException ("Mode failed setupMechanics(): 'inputs' must be instantiated or deserialized " +
                    "before calling this method.");

            modeMechanics.load<Mechanic> (defaultMechanicTypeName, ref defaultMechanic);
            modeMechanics.load<Mechanic> (mechanicTypeNames, ref mechanics);
            modeMechanics.load<Mechanic> (finishMechanicTypeName, ref finishMechanic);

            foreach (Mechanic mech in mechanics) {
                mech.init (gameObject, customPhysics, inputs);
            }

            if (defaultMechanic != null) {
                defaultMechanic.init (gameObject, customPhysics, inputs);
            } else {
                Debug.LogError ("Default Mechanic not setup!");
            }

            if (finishMechanic != null) {
                finishMechanic.init (gameObject, customPhysics, inputs);
            }
        }
Пример #8
0
 public override void init(GameObject go, System.Object customPhysics, Inputs inputs)
 {
     flightPhysics = (FlightPhysics)customPhysics;
     base.init (go);
     setupAnimation (glidingAnimation, ref glidingHash);
 }