Esempio n. 1
0
 void Start()
 {
     this.controler             = GetComponent <CharacterController>();
     this.checkPush             = false;
     this.controllerHitSequence = GameObject.Find("Jumba").GetComponent <ControllerHitSequence>();
     this.raycastDistance       = GameObject.Find("Jumba").GetComponent <RayCastDistance>();
 }
Esempio n. 2
0
    void Start()
    {
        // Cache component lookup at startup instead of doing this every frame
        this.character             = GetComponent <CharacterController>();
        this.stateControl          = GetComponent <PlayerStateControl>();
        this.controllerHitSequence = GetComponent <ControllerHitSequence>();
        this.raycastDistance       = GetComponent <RayCastDistance>();

        rayDistance = (this.character.height / 4.0f) + (this.character.height / 2.0f);

        positionZ = transform.position.z;
    }