// Use this for initialization
	void Start () {
		throwScript = GetComponent<throwing> ();
		pearlOffset = transform.GetChild(0).gameObject;
		beaverSprite = transform.GetChild (1).gameObject;
		pearlRenderer = pearlOffset.GetComponent<SpriteRenderer>();
		colDetectScript = transform.GetComponent<collision_detection> ();

		InvokeRepeating ("DemoThrow", 0.05f, 2.0f);
	}
    // Use this for initialization
    void Start()
    {
        throwScript = GetComponent<throwing> ();
        pearlOffset = transform.GetChild(0).gameObject;
        beaverSprite = transform.GetChild (1).gameObject;
        pearlRenderer = pearlOffset.GetComponent<SpriteRenderer>();
        colDetectScript = transform.GetComponent<collision_detection> ();

        InvokeRepeating ("DemoThrow", 0.05f, 2.0f);
    }
示例#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
    // 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>();
    }
示例#5
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()
    {
        //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>();
    }