Exemple #1
0
    // Use this for initialization
    void Start()
    {
        rBody = GetComponent <Rigidbody2D>();

        //get reference to the animator located on the beaver_sprite child object
        beaverSprite = transform.GetChild(1).gameObject;
        animator     = beaverSprite.GetComponent <Animator>();

        //reference to the beaver mouth (to determine if can breath)
        beaverMouth = beaverSprite.transform.GetChild(1).gameObject;

        moveInputScript   = gameObject.GetComponent <get_input>();
        playerStateScript = gameObject.GetComponent <player_state>();

        facingAngle = 0.0f;

        facingRight = true; //facing right initially

        leftAnalogThresh = 0.001f;

        moveForce = constants.moveForceNormal;

        animator.SetBool("on_land", true);
        animator.SetBool("is_moving", false);

        soundPlayer = GameObject.FindGameObjectWithTag("Sound_Player").GetComponent <sound_player>();

        //team 2 faces left to start
        if (playerStateScript.GetTeamNumber() == "2")
        {
            Flip();
        }
    }
    // Use this for initialization
    void Start()
    {
        inputScript       = gameObject.GetComponent <get_input>();
        playerStateScript = gameObject.GetComponent <player_state>();
        movingScript      = gameObject.GetComponent <moving>();
        pearlOffset       = transform.GetChild(0).gameObject;

        pearlRenderer = pearlOffset.GetComponent <SpriteRenderer>();
        anim          = pearlOffset.GetComponent <Animator> ();

        throwAngle      = 0.0f;
        aimingThreshold = 0.001f;         // if this value is too high the aiming tends to snap to the NSEW directions (0.2 was too high)
    }
    // Use this for initialization
    void Start()
    {
        inputScript = gameObject.GetComponent<get_input>();
        playerStateScript = gameObject.GetComponent<player_state>();
        movingScript = gameObject.GetComponent<moving>();
        pearlOffset = transform.GetChild(0).gameObject;

        pearlRenderer = pearlOffset.GetComponent<SpriteRenderer>();
        anim = pearlOffset.GetComponent<Animator> ();

        throwAngle = 0.0f;
        aimingThreshold = 0.001f; // if this value is too high the aiming tends to snap to the NSEW directions (0.2 was too high)
    }
    void Start()
    {
        r_body = GetComponent <Rigidbody2D>();

        dashInputScript   = GetComponent <get_input>();
        playerStateScript = GetComponent <player_state>();
        movingScript      = GetComponent <moving>();
        // throwingScript = GetComponent<throwing>();

        soundPlayer = GameObject.FindGameObjectWithTag("Sound_Player").GetComponent <sound_player>();

        //get reference to the animator located on the beaver_sprite child object
        beaverSprite = transform.GetChild(1).gameObject;
        animator     = beaverSprite.GetComponent <Animator>();
    }
    void Start()
    {
        //get references to the child object
        pearlOffset = transform.GetChild(0).gameObject;
        beaverSprite = transform.GetChild (1).gameObject;

        //get reference to the sprite renderer located on the pearlOffset child object
        pearlRenderer = pearlOffset.GetComponent<SpriteRenderer>();

        throwInputScript = gameObject.GetComponent<get_input>();
        aimingDirScript = gameObject.GetComponent<aiming>();
        colDetectScript = transform.GetComponent<collision_detection> ();
        playerStateScript = GetComponent<player_state>();

        soundPlayer = GameObject.FindGameObjectWithTag ("Sound_Player").GetComponent<sound_player>();
    }
Exemple #6
0
    void Start()
    {
        //get references to the child object
        pearlOffset  = transform.GetChild(0).gameObject;
        beaverSprite = transform.GetChild(1).gameObject;

        //get reference to the sprite renderer located on the pearlOffset child object
        pearlRenderer = pearlOffset.GetComponent <SpriteRenderer>();

        throwInputScript  = gameObject.GetComponent <get_input>();
        aimingDirScript   = gameObject.GetComponent <aiming>();
        colDetectScript   = transform.GetComponent <collision_detection> ();
        playerStateScript = GetComponent <player_state>();

        soundPlayer = GameObject.FindGameObjectWithTag("Sound_Player").GetComponent <sound_player>();
    }
    // Use this for initialization
    void Start()
    {
        rBody = GetComponent<Rigidbody2D>();

        //get reference to the animator located on the beaver_sprite child object
        beaverSprite = transform.GetChild(1).gameObject;
        animator = beaverSprite.GetComponent<Animator>();

        //reference to the beaver mouth (to determine if can breath)
        beaverMouth = beaverSprite.transform.GetChild (1).gameObject;

        moveInputScript = gameObject.GetComponent<get_input>();
        playerStateScript = gameObject.GetComponent<player_state>();

        facingAngle = 0.0f;

        facingRight = true; //facing right initially

        leftAnalogThresh = 0.001f;

        moveForce = constants.moveForceNormal;

        animator.SetBool ("on_land", true);
        animator.SetBool ("is_moving", false);

        soundPlayer = GameObject.FindGameObjectWithTag ("Sound_Player").GetComponent<sound_player>();

        //team 2 faces left to start
        if (playerStateScript.GetTeamNumber () == "2") {
            Flip ();
        }
    }
    void Start()
    {
        r_body = GetComponent<Rigidbody2D>();

        dashInputScript = GetComponent<get_input>();
        playerStateScript = GetComponent<player_state>();
        movingScript = GetComponent<moving>();
           // throwingScript = GetComponent<throwing>();

        soundPlayer = GameObject.FindGameObjectWithTag ("Sound_Player").GetComponent<sound_player>();

        //get reference to the animator located on the beaver_sprite child object
        beaverSprite = transform.GetChild(1).gameObject;
        animator = beaverSprite.GetComponent<Animator>();
    }