Exemplo n.º 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="go">Vehicle game object.</param>
        public GameVehicle(GameObject go)
        {
            gameObject = go;

            dynamics = gameObject.GetComponent <CarDynamics>();
            Client.Assert(dynamics != null, "Missing car dynamics!");

            driveTrain = gameObject.GetComponent <Drivetrain>();

            axisCarController = gameObject.GetComponent <AxisCarController>();
            mpCarController   = gameObject.AddComponent <MPCarController>();

            PlayMakerFSM[] fsms = gameObject.GetComponentsInChildren <PlayMakerFSM>();

            foreach (var fsm in fsms)
            {
                if (fsm.FsmName == "PlayerTrigger")
                {
                    SetupPlayerTriggerHooks(fsm);

                    // Temp - use player trigger..
                    seatGameObject = fsm.gameObject;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="go"></param>
        public PlayerVehicle(GameObject go, ObjectSyncComponent osc)
        {
            gameObject       = go;
            syncComponent    = osc;
            ParentGameObject = go.transform.parent.parent.gameObject;

            rigidbody  = ParentGameObject.GetComponent <Rigidbody>();
            dynamics   = ParentGameObject.GetComponent <CarDynamics>();
            driveTrain = ParentGameObject.GetComponent <Drivetrain>();

            axisCarController = ParentGameObject.GetComponent <AxisCarController>();
            mpCarController   = ParentGameObject.AddComponent <MPCarController>();

            FindFSMs();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="go"></param>
        public PlayerVehicle(GameObject go, ObjectSyncComponent osc)
        {
            gameObject       = go;
            syncComponent    = osc;
            ParentGameObject = go.transform.parent.parent.gameObject;

            if (ParentGameObject.name.StartsWith("JONNEZ"))
            {
                isBike        = true;
                steeringPivot = ParentGameObject.transform.FindChild("LOD/Suspension/Steering/SteeringPivot").gameObject;
            }

            rigidbody  = ParentGameObject.GetComponent <Rigidbody>();
            dynamics   = ParentGameObject.GetComponent <CarDynamics>();
            driveTrain = ParentGameObject.GetComponent <Drivetrain>();

            axisCarController = ParentGameObject.GetComponent <AxisCarController>();
            mpCarController   = ParentGameObject.AddComponent <MPCarController>();

            AddVehicleDoorSync();
            FindFSMs();
        }