Inheritance: UnityEngine.MonoBehaviour
 void Awake()
 {
     m_myRigid = GetComponent<Rigidbody>();
     m_anim = GetComponent<Animator>();
     m_shipStates = GetComponent<StateManager>();
     m_passTray = GetComponentInChildren<PassengerTray>();
 }
        void Start()
        {
            GameManager gameManager = FindObjectOfType<GameManager>();
            if (gameManager == null)
            {
                Debug.LogError("Can't find Game Manager within scene");
            }

            GameObject player = gameManager.players[playerNumber - 1];
            m_playerWeaponSystem = player.GetComponent<Countermeasures>();
            if (m_playerWeaponSystem == null)
            {
                Debug.LogError("Unable to find player Counter Measure Script");
            }

            m_playerStateManager = player.GetComponent<StateManager>();
            if (m_playerStateManager == null)
            {
                Debug.LogError("Unable to find player StateManager Script");
            }
        }
 public void Awake()
 {
     m_standardControl   = GetComponent<AirshipControlBehaviour>();
     m_fireshipControl   = GetComponent<AirshipSuicideBehaviour>();
     m_rouletteControl   = GetComponent<RouletteBehaviour>();
     m_rotateCam         = GetComponent<RotateCam>();
     m_broadSideWeapons  = GetComponent<BroadsideWeaponsController>();
     m_countermeasures 	= GetComponent<Countermeasures> ();
     m_stateManager 		= GetComponent<StateManager>();
 }
示例#4
0
        void Start()
        {
            // Cache variables
            m_referenceStateManager = GetComponent<StateManager>();
            m_shipTrans = transform;
            m_camRotTrans = rotateCam.transform;

            announcerController = GameObject.FindObjectOfType<UI_Controller>();
        }
 void Awake()
 {
     m_canvasText = canvasChild.GetComponentInChildren<Text>();
     m_stateManager = airshipTopOfHierachy.GetComponent<StateManager>();
 }
        void Awake()
        {
            // Get Rigidbody variables
            m_myRigid = GetComponent<Rigidbody>();
            m_trans = transform;

            m_myRigid.mass = adjustableMass;
            m_startShipMass = adjustableMass;

            m_anim = GetComponent<Animator>();
            m_shipPartDestroy = GetComponent<ShipPartDestroy>();
            m_shipStallScript = GetComponent<AirshipStallingBehaviour>();
            m_shipStates = GetComponent<StateManager>();

            m_tray = GetComponentInChildren<PassengerTray>();
        }
 void Awake()
 {
     m_myRigid = gameObject.GetComponent<Rigidbody>();
     m_anim = GetComponent<Animator>();
     m_stateManager = GetComponent<StateManager>();
 }
 void Awake()
 {
     m_trans = transform;
     m_rb = GetComponent<Rigidbody>();
     m_shipTray = GetComponentInChildren<PassengerTray>();
     m_shipStates = GetComponent<StateManager>();
     m_bumpVelSqr = bumpVelThreshold * bumpVelThreshold;
 }
        void OnEnable()
        {
            if (m_parentStateManager == null)
            {
                m_parentStateManager = m_trans.GetComponentInParent<StateManager>();
            }

            // Reset Position
            m_trans.localPosition = Vector3.zero;
            m_trans.localRotation = Quaternion.Euler(Vector3.zero);
            m_trans.localScale = new Vector3(4, 1, 1);	// Try not to change these

            // Set Components of the rigidbody at the start
            m_myRigid.isKinematic = false;
            m_myRigid.useGravity = false;

            m_myRigid.drag = 0;
            m_myRigid.angularDrag = 0.001f;	// Low on start

            m_myRigid.maxAngularVelocity = 14;

            targetFinalRotation = Quaternion.identity;

            // Get the start rotation of the handle joint
            rotateAmount = 0;

            // Reset variables
            m_currEndWait = rouletteEndWait;
            m_rouletteDone = false;

            // Make the wheel spin
            Spin();
        }