Esempio n. 1
0
    void Awake()
    {
        characterController = GetComponent <CharacterController> ();
        camera    = Camera.main;
        mouseLook = new MouseLook();
        mouseLook.Init(transform, camera.transform);

        weapon   = gameObject.GetComponent <PlayerWeapon> ();
        light    = gameObject.GetComponent <PlayerLight> ();
        interact = gameObject.GetComponent <PlayerInteract> ();
        buffs    = gameObject.GetComponent <PlayerBuffs> ();
        traps    = gameObject.GetComponent <PlayerTraps> ();
        ability1 = gameObject.GetComponent <PlayerAbility1> ();
        health   = gameObject.GetComponent <PlayerHealth> ();
        aim      = gameObject.GetComponent <HumanAim> ();
        grenade  = GetComponent <PlayerGrenade> ();
        player   = GetComponent <Player> ();

        animator = GetComponentInChildren <Animator> ();
        audio    = GetComponentInChildren <AudioSource> ();

        gameManager = FindObjectOfType <GameManager> ();

        IsWalking = false;
        IsRunning = false;
        IsJumping = false;

        verticalSpeed = 0f;
        timer         = 0f;
        jetPackTimer  = jetPackTime;
    }
Esempio n. 2
0
    void Awake()
    {
        barrel    = transform.Find("Model/Head/RightHand/Gun/BarrelEnd").gameObject;
        player    = GetComponent <Player> ();
        humanAim  = GetComponent <HumanAim> ();
        camera    = transform.Find("Model/Head").gameObject.GetComponent <Camera> ();
        rightHand = transform.Find("Model/Head/RightHand").gameObject;


        recoilTarget     = new Vector3(-maxDeviationX, maxDeviationY, maxDeviationZ);
        downwardPosition = new Vector3(-downwardDeviationX, 0f, 0f);

        overloadVal   = 0f;
        overLoaded    = false;
        overloadEvent = new EventName(OverloadBar.OVERLOAD_BAR_CHANNEL);
    }