Ejemplo n.º 1
0
    public void ReplaceCarScripts()
    {
        print("resetting car");
        if (carAlignScript == null)
        {
            carAlignScript = this.gameObject.AddComponent <CarAlignToBezier>();
            SetAlignScriptToInit();
        }
        if (carFollowScript == null)
        {
            carFollowScript = this.gameObject.AddComponent <CarFollowBezier>();
            SetFollowScriptToInit();
        }

        if (rb == null)
        {
            rb = this.gameObject.AddComponent <Rigidbody>();
            SetRigidBodyVariables();
        }
    }
Ejemplo n.º 2
0
 private void Start()
 {
     followBezier = GetComponent <CarFollowBezier>();
 }
Ejemplo n.º 3
0
 private void Awake()
 {
     carAlignScript  = GetComponent <CarAlignToBezier>();
     carFollowScript = GetComponent <CarFollowBezier>();
     rb = GetComponent <Rigidbody>();
 }
Ejemplo n.º 4
0
 private void Start()
 {
     followBezier = GetComponent <CarFollowBezier>();
     rb           = GetComponent <Rigidbody>();
 }