void Start()
    {
        damRampLeft  = GameObject.Find("Dam_Ramp_Left");
        damRampRight = GameObject.Find("Dam_Ramp_Right");

        soundPlayer = GameObject.Find("Sound_Player").GetComponent <sound_player>();
    }
示例#2
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();
        }
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        //dashInputScript = GetComponent<get_input>();
        playerStateScript = GetComponent <player_state>();
        movingScript      = GetComponent <moving>();
        throwingScript    = GetComponent <throwing>();

        animator = transform.GetChild(1).gameObject.GetComponent <Animator> ();

        soundPlayer = GameObject.FindGameObjectWithTag("Sound_Player").GetComponent <sound_player>();
    }
示例#4
0
    void Start()
    {
        clamSprite        = gameObject.GetComponentInParent <SpriteRenderer>();
        animator          = gameObject.GetComponentInParent <Animator>();
        scoreKeeperScript = GameObject.Find("Score_Keeper").GetComponent <score_keeper> ();


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

        spawnPoints = GameObject.FindGameObjectsWithTag("Jellyfish");
    }
示例#5
0
    // Use this for initialization
    void Start()
    {
        //dashInputScript = GetComponent<get_input>();
        playerStateScript = GetComponent<player_state>();
        movingScript = GetComponent<moving>();
        throwingScript = GetComponent<throwing>();

        animator = transform.GetChild(1).gameObject.GetComponent<Animator> ();

        soundPlayer = GameObject.FindGameObjectWithTag ("Sound_Player").GetComponent<sound_player>();
    }
示例#6
0
    void Start()
    {
        //get the state script
        playerStateScript = GetComponent <player_state> ();

        //get the
        GameObject beaverSprite = transform.GetChild(1).gameObject;

        beaverMouth = transform.GetChild(1).gameObject;

        beaverPearlCollider = beaverSprite.transform.GetChild(0).gameObject;

        // get Player name form patent object
        Player_name = gameObject.transform.name;


        //gettign the scripts that will be disabled
        movingScript    = GetComponent <moving> ();
        dashScript      = GetComponent <dash> ();
        throwingScript  = GetComponent <throwing> ();
        colDetectScript = GetComponent <collision_detection> ();

        //get the scripts to animate the indicator

//		if (Player_name == "Beaver1") {
//			iconIndicator = GameObject.FindGameObjectWithTag ("iconP1").GetComponent<Animator>();
//
//		} else if (Player_name == "Beaver2") {
//			iconIndicator = GameObject.FindGameObjectWithTag ("iconP2").GetComponent<Animator>();
//		}

        //getting the particle system
        Bubbles = beaverMouth.GetComponentInChildren <ParticleSystem> ();

        //setting the emmision to 0
        Bubbles.emissionRate = 0;

        //initially not suffocating
        //isSuffocating = false;
        playerStateScript.SetIsSuffocating(false);

        // gettign the ridgit body of the Player
        rBody = GetComponent <Rigidbody2D> ();


        // getting the animator.
        animator = transform.GetChild(1).gameObject.GetComponent <Animator> ();

        soundPlayer = GameObject.FindGameObjectWithTag("Sound_Player").GetComponent <sound_player>();
    }
    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>();
    }
示例#8
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()
    {
        //get references to the child objects
        pearlOffset = transform.GetChild(0).gameObject;

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

        playerStateScript = gameObject.GetComponent <player_state>();

        numberOfPlatformsTouching = 0;

        damageScript = GetComponent <damage> ();

        rBody = GetComponent <Rigidbody2D> ();

        scoreScript = GameObject.FindGameObjectWithTag("Score_Keeper").GetComponent <score_keeper>();

        statusAnim = GetComponent <Animator> ();

        soundPlayer = GameObject.FindGameObjectWithTag("Sound_Player").GetComponent <sound_player>();
    }
    void Start()
    {
        //get the state script
        playerStateScript = GetComponent<player_state> ();

        //get the
        GameObject beaverSprite = transform.GetChild (1).gameObject;
        beaverMouth = transform.GetChild (1).gameObject;

        beaverPearlCollider = beaverSprite.transform.GetChild (0).gameObject;

        // get Player name form patent object
        Player_name = gameObject.transform.name;

        //gettign the scripts that will be disabled
        movingScript = GetComponent<moving> ();
        dashScript = GetComponent<dash> ();
        throwingScript = GetComponent<throwing> ();
        colDetectScript = GetComponent<collision_detection> ();

        //get the scripts to animate the indicator

        //		if (Player_name == "Beaver1") {
        //			iconIndicator = GameObject.FindGameObjectWithTag ("iconP1").GetComponent<Animator>();
        //
        //		} else if (Player_name == "Beaver2") {
        //			iconIndicator = GameObject.FindGameObjectWithTag ("iconP2").GetComponent<Animator>();
        //		}

        //getting the particle system
        Bubbles = beaverMouth.GetComponentInChildren<ParticleSystem> ();

        //setting the emmision to 0
        Bubbles.emissionRate = 0;

        //initially not suffocating
        //isSuffocating = false;
        playerStateScript.SetIsSuffocating (false);

        // gettign the ridgit body of the Player
        rBody = GetComponent<Rigidbody2D> ();

        // getting the animator.
        animator = transform.GetChild (1).gameObject.GetComponent<Animator> ();

        soundPlayer = GameObject.FindGameObjectWithTag ("Sound_Player").GetComponent<sound_player>();
    }
示例#11
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>();
    }
    void Start()
    {
        clamSprite = gameObject.GetComponentInParent<SpriteRenderer>();
        animator = gameObject.GetComponentInParent<Animator>();
        scoreKeeperScript = GameObject.Find ("Score_Keeper").GetComponent<score_keeper> ();

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

        spawnPoints = GameObject.FindGameObjectsWithTag("Jellyfish");
    }
    // Use this for initialization
    void Start()
    {
        //get references to the child objects
        pearlOffset = transform.GetChild (0).gameObject;

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

        playerStateScript = gameObject.GetComponent<player_state>();

        numberOfPlatformsTouching = 0;

        damageScript = GetComponent<damage> ();

        rBody = GetComponent<Rigidbody2D> ();

        scoreScript = GameObject.FindGameObjectWithTag("Score_Keeper").GetComponent<score_keeper>();

        statusAnim = GetComponent<Animator> ();

        soundPlayer = GameObject.FindGameObjectWithTag ("Sound_Player").GetComponent<sound_player>();
    }
示例#14
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 ();
        }
    }
示例#15
0
    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>();
    }