예제 #1
0
    // Initial basic initialization
    private void Awake()
    {
        engine = null;
        rb     = null;

        turnRate = 0f;
        rollDeg  = 0f;
        throttle = 0f;
    }
예제 #2
0
    // Gets the component references and initiales the heading.
    void Start()
    {
        heading        = gameObject.transform.rotation.eulerAngles.y * Mathf.Rad2Deg;
        desiredHeading = heading;

        engine = GetComponent <ShipThrustComponent>();

        rb             = GetComponent <Rigidbody>();
        rb.useGravity  = false;
        rb.constraints = RigidbodyConstraints.FreezePositionY;
    }