// Update is called once per frame void Update() { GameObject girlll = GameObject.Find("Bro"); movement_clouder gf = girlll.GetComponent <movement_clouder> (); girl = gf.girl; Vector2 offset = GetComponent <Renderer> ().material.mainTextureOffset; GameObject kapsimo = GameObject.Find("clouds"); clouder kahla = kapsimo.GetComponent <clouder> (); kamenos = kahla.kamenos; GameObject kapsimo2 = GameObject.Find("clouds_2"); clouder_2 kahla2 = kapsimo2.GetComponent <clouder_2> (); kamenos2 = kahla2.kamenos2; GameObject kapsimo3 = GameObject.Find("clouds_3"); clouder_3 kahla3 = kapsimo3.GetComponent <clouder_3> (); kamenos3 = kahla3.kamenos3; if (kamenos || kamenos2 || kamenos3 || girl) { speed = 0; } Application.targetFrameRate = 60; //Vector2 offset2 = GetComponent<Renderer>().material.mainTextureOffset; offset.x += speed * (Time.deltaTime / 10); offset.x = (offset.x) % 1; GetComponent <Renderer> ().material.mainTextureOffset = offset; }
// Update is called once per frame void Update() { GameObject kapsimo = GameObject.Find("clouds"); clouder kahla = kapsimo.GetComponent <clouder> (); kamenos = kahla.kamenos; GameObject kapsimo2 = GameObject.Find("clouds_2"); clouder_2 kahla2 = kapsimo2.GetComponent <clouder_2> (); kamenos2 = kahla2.kamenos2; GameObject kapsimo3 = GameObject.Find("clouds_3"); clouder_3 kahla3 = kapsimo3.GetComponent <clouder_3> (); kamenos3 = kahla3.kamenos3; if (kamenos || kamenos2 || kamenos3) { DoShake(); } if (ShakeIntensity > 0) { transform.position = OriginalPos + Random.insideUnitSphere * ShakeIntensity; transform.rotation = new Quaternion(OriginalRot.x + Random.Range(-ShakeIntensity, ShakeIntensity) * .2f, OriginalRot.y + Random.Range(-ShakeIntensity, ShakeIntensity) * .2f, OriginalRot.z + Random.Range(-ShakeIntensity, ShakeIntensity) * .0f, OriginalRot.w + Random.Range(-ShakeIntensity, ShakeIntensity) * .0f); ShakeIntensity -= ShakeDecay; } else if (Shaking) { Shaking = false; } }
// Update is called once per frame void Update() { GameObject kapsimo = GameObject.Find("clouds"); clouder kahla = kapsimo.GetComponent <clouder> (); kamenos = kahla.kamenos; GameObject kapsimo2 = GameObject.Find("clouds_2"); clouder_2 kahla2 = kapsimo2.GetComponent <clouder_2> (); kamenos2 = kahla2.kamenos2; GameObject kapsimo3 = GameObject.Find("clouds_3"); clouder_3 kahla3 = kapsimo3.GetComponent <clouder_3> (); kamenos3 = kahla3.kamenos3; if (player != null && !kamenos && !kamenos2 && !kamenos3) { Vector3 pos = transform.position; pos.x = player.position.x + offsetX; pos.y = player.position.y + offsetY; transform.position = pos; } }
void Update() { Renderer rend = glasses.GetComponent <Renderer>(); Renderer rend2 = hat.GetComponent <Renderer>(); if (using_glasses == 1) { rend.enabled = true; } else { rend.enabled = false; } if (using_hat == 1) { rend2.enabled = true; } else { rend2.enabled = false; } GameObject player_object = GameObject.Find("Bro"); Vector3 player_pos_x = player_object.transform.position; Vector3 temp = player_object.transform.position; temp.x = player_object.transform.position.x; player_pos_x = temp; if (player_pos_x.x > 148) { animator.Play("Thug_Life"); erwthseis = true; my_girl(); GameObject girly = GameObject.Find("girl"); Animator girlish = girly.GetComponent <Animator>(); girlish.Play("free_da_girl"); girl = true; } // if (player_pos_x.x > 4) // { // GameObject cloudz = GameObject.Find("Clouders"); // Vector3 scale = transform.localScale; // scale.x = 1.7f; // scale.y = 1.7f; // cloudz.transform.localScale = scale; // } GameObject skori = GameObject.Find("Bro"); movement_clouder keimeno = skori.GetComponent <movement_clouder> (); current_score = keimeno.Score; GameObject fin = GameObject.Find("Initial Hello"); gkomena gf = fin.GetComponent <gkomena> (); finished = gf.finished; GameObject kapsimo = GameObject.Find("clouds"); clouder kahla = kapsimo.GetComponent <clouder> (); kamenos = kahla.kamenos; GameObject kapsimo2 = GameObject.Find("clouds_2"); clouder_2 kahla2 = kapsimo2.GetComponent <clouder_2> (); kamenos2 = kahla2.kamenos2; GameObject kapsimo3 = GameObject.Find("clouds_3"); clouder_3 kahla3 = kapsimo3.GetComponent <clouder_3> (); kamenos3 = kahla3.kamenos3; GameObject player = GameObject.Find("ControlButtons_clouder"); Touch_clouder gateController = player.GetComponent <Touch_clouder> (); mov = gateController.moving; Points.text = "Points = " + Score; if (sms) { GameObject.Find("Health Bar").GetComponent <HealthBar>().Damage(10); sms = false; } GameObject cloud3 = GameObject.Find("clouds_3"); clouder_3 c3 = cloud3.GetComponent <clouder_3> (); clouds_3 = c3.kopanhse3; GameObject cloud2 = GameObject.Find("clouds_2"); clouder_2 c2 = cloud2.GetComponent <clouder_2> (); clouds_2 = c2.kopanhse2; GameObject clouds1 = GameObject.Find("clouds"); clouder c = clouds1.GetComponent <clouder> (); clouds_1 = c.kopanhse; sc1 = c.score; sc2 = c2.score; sc3 = c3.score; total = sc1 + sc2 + sc3; Points.text = "Points = " + total; Total_Points_Clouder = total; if (total > highscore_cloud) { PlayerPrefs.SetInt("highscore_cloud", total); } GameObject change = GameObject.Find("Laserous"); ChooseWeapon l = change.GetComponent <ChooseWeapon>(); changed = l.change_weapon; GameObject da_laser = GameObject.Find("Laserous"); ChooseWeapon laser = da_laser.GetComponent <ChooseWeapon>(); exei_laser = laser.using_laser; GameObject using_punch = GameObject.Find("Laserous"); ChooseWeapon bounia = using_punch.GetComponent <ChooseWeapon>(); bounidi = bounia.using_punch; if (kamenos || kamenos2 || kamenos3) { animator.Play("kamenos"); GetComponent <Rigidbody2D>().AddForce(Vector2.down * 5f); GameObject.Find("Health Bar").GetComponent <HealthBar>().Damage(100); setGrand(); GameObject Floor = GameObject.Find("Floor"); Floor.GetComponent <BoxCollider2D>().isTrigger = true; } if (kopanhse || kopanhse2 || kopanhse3) { //animator.Play("Hit"); // gameObject.GetComponentInChildren<Renderer>().enabled = false; // animator.enabled = false; } if (Input.GetMouseButtonDown(0) && !pause && !mov && !sms && !changed && !thug_life && !kamenos && !kamenos2 && !kamenos3 && !finished && !erwthseis) { if (bounidi) { animator.Play("myAnimationBros 1"); } if (exei_laser) { animator.Play("Laserino"); } animator.SetTrigger("Idle"); } }