Ejemplo n.º 1
0
 void Start()
 {
     if (!rb)
     {
         rb = GetComponent <Rigidbody>();
     }
     if (!crouch)
     {
         crouch = GetComponent <CrouchScript>();
     }
     if (!controller)
     {
         controller = GetComponent <MovementController>();
     }
     if (!charController)
     {
         charController = GetComponent <CharacterController>();
     }
     if (!castPoint)
     {
         castPoint = controller.groundCheck;
     }
     rb.useGravity       = false;
     rb.detectCollisions = false;
     rb.isKinematic      = true;
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     if (!mController)
     {
         mController = GetComponent <MovementController>();
     }
     if (!sController)
     {
         sController = GetComponent <SlideScript>();
     }
     if (!cController)
     {
         cController = GetComponent <CrouchScript>();
     }
     if (!gController)
     {
         gController = GetComponent <GlideScript>();
     }
     if (!fController)
     {
         fController = GetComponent <FlyScript>();
     }
 }