Пример #1
0
    // Use this for initialization
    void Start()
    {
        gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
        playerInputs   = gameController.gameObject.GetComponent <PlayerInputsScript>();

        if (currentScene == "Level")
        {
            playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
        }
    }
Пример #2
0
    // Used for initialization
    void Start()
    {
        gameController  = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
        playerInputs    = gameController.gameObject.GetComponent <PlayerInputsScript>();
        hoverScript     = GetComponent <HoverScript>();
        audioController = GetComponent <AudioController>();

        rigBody = GetComponent <Rigidbody>();
        rigBody.maxAngularVelocity = 5;

        com = rigBody.centerOfMass - new Vector3(0, 0, rigBody.centerOfMass.z);
        rigBody.centerOfMass = com;

        turnForce  *= rigBody.mass;
        yawForce   *= rigBody.mass;
        pitchForce *= rigBody.mass;
        rollForce  *= rigBody.mass;
        fakeRoll   *= rigBody.mass;
    }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     playerInputs = GameObject.FindGameObjectWithTag("GameController").GetComponent <PlayerInputsScript>();
 }