private void Start() { if (isBoss == true) { StartCoroutine("FireStart"); } HelthBar[] oponenthealthbars1 = GetComponentsInChildren <HelthBar>(); foreach (HelthBar thehealth in oponenthealthbars1) { thehealth.SetMaxHealth(maxHealth); thehealth.gameObject.SetActive(true); thehealth.transform.parent.gameObject.SetActive(true); healthbar = thehealth; } foreach (damage Damagemultiplyer in GetComponentsInChildren <damage>()) { Damagemultiplyer.multiplyer = 0.5f; } camerashake = FindObjectOfType <Camera>().GetComponent <StressReceiver>(); OnFireParticles.Stop(); FireParticles.Stop(); psIce.Stop(); readytofire = true; springjoint.enabled = false; FollowMouse[] followMouse = GetComponentsInChildren <FollowMouse>(); foreach (FollowMouse FollowTheMouse in followMouse) { FollowTheMouse.enabled = true; } springjoint = GetComponentInChildren <SpringJoint2D>(); cam = FindObjectOfType <Camera>(); //healthbar = GameObject.FindGameObjectWithTag("OwnHealthBar").GetComponent<HelthBar>(); //GameObject[] oponenthealthbars = GameObject.FindGameObjectsWithTag("OponentsHealthbar"); //foreach (GameObject thehealth in oponenthealthbars) //{ //thehealth.SetActive(true); //healthbar = thehealth.GetComponentInChildren<HelthBar>(); //} currentHealth = maxHealth; healthbar.SetMaxHealth(maxHealth); Rigidbody2D[] Gravity01 = GetComponentsInChildren <Rigidbody2D>(); SaveJumpForce = jumpForce; if (!photonView.isMine) { Rigidbody2D[] rbChildren = GetComponentsInChildren <Rigidbody2D>(); foreach (Rigidbody2D RBCHILDREN in rbChildren) { RBCHILDREN.isKinematic = true; RBCHILDREN.gravityScale = 0; } } }
public void Start() { currentHealth = health; healthBar.SetMaxHealth(health); anim = GetComponent <Animator>(); }
private void Start() { if (MenuController.power == 3) { damage[] dammage = GetComponentsInChildren <damage>(); foreach (damage DAMAGE in dammage) { DAMAGE.multiplyer = 0.8f; } } GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); ownplayernumber = players.Length; if (MenuController.power == 2) { maxEnergy = 50; } dashCount = startDashCount; camerashake = FindObjectOfType <Camera>().GetComponent <StressReceiver>(); if (MenuController.power == 3 && photonView.isMine) { maxHealth += 50; SaveJumpForce += 1000; jumpForce += 1000; FollowMouse[] thefollowMouse = GetComponentsInChildren <FollowMouse>(); foreach (FollowMouse FollowTheMouse in thefollowMouse) { FollowTheMouse.Maxspeed += 10; } Rigidbody2D[] rbChildren = GetComponentsInChildren <Rigidbody2D>(); foreach (Rigidbody2D RBCHILDREN in rbChildren) { RBCHILDREN.mass += 0.1f; } } OnFireParticles.Stop(); FireParticles.Stop(); psIce.Stop(); if (MenuController.power == 2 && photonView.isMine) { SpriteRenderer[] Transparency = GetComponentsInChildren <SpriteRenderer>(); foreach (SpriteRenderer theTransparency in Transparency) { theTransparency.color = new Color(0.15f, 0.15f, 0.15f, 1f); } photonView.RPC("Invisibillity", PhotonTargets.OthersBuffered); photonView.RPC("hidehealthbar", PhotonTargets.OthersBuffered); } if (MenuController.power == 3 && photonView.isMine) { maxEnergy -= 50; } currentEnergy = maxEnergy; readytofire = true; springjoint.enabled = false; lr.enabled = false; FollowMouse[] followMouse = GetComponentsInChildren <FollowMouse>(); foreach (FollowMouse FollowTheMouse in followMouse) { FollowTheMouse.enabled = true; } springjoint = GetComponentInChildren <SpringJoint2D>(); cam = FindObjectOfType <Camera>(); if (MenuController.selectedgamemode == 2) { SpeedBar = GameObject.FindGameObjectWithTag("SpeedBar").GetComponent <HelthBar>(); StrenghtBar = GameObject.FindGameObjectWithTag("StrenghtBar").GetComponent <HelthBar>(); HealthboostBar = GameObject.FindGameObjectWithTag("HealthboostBar").GetComponent <HelthBar>(); JumpboostBar = GameObject.FindGameObjectWithTag("JumpboostBar").GetComponent <HelthBar>(); HealthboostBar.SetMaxHealth(20); StrenghtBar.SetMaxHealth(20); JumpboostBar.SetMaxHealth(20); SpeedBar.SetMaxHealth(20); HealthboostBar.SetHealth(0); StrenghtBar.SetHealth(0); JumpboostBar.SetHealth(0); SpeedBar.SetHealth(0); } healthbar = GameObject.FindGameObjectWithTag("OwnHealthBar").GetComponent <HelthBar>(); energybar = GameObject.FindGameObjectWithTag("EnergyBar").GetComponent <HelthBar>(); GameObject[] oponenthealthbars = GameObject.FindGameObjectsWithTag("OponentsHealthbar"); if (photonView.isMine) { energybar.SetMaxHealth(maxEnergy); } foreach (GameObject thehealth in oponenthealthbars) { if (!thehealth.GetComponent <PhotonView>().isMine) { Oponenthealthbar = thehealth.GetComponent <HelthBar>(); thehealth.SetActive(true); } else { thehealth.SetActive(false); } } if (GameManager.playernumber == ownplayernumber && MenuController.selectedgamemode == 5) { Snow.Play(); } jumpForce *= 1.75f; currentHealth = maxHealth; healthbar.SetMaxHealth(maxHealth); if (Oponenthealthbar) { Oponenthealthbar.SetMaxHealth(maxHealth); } Rigidbody2D[] Gravity01 = GetComponentsInChildren <Rigidbody2D>(); SaveJumpForce = jumpForce; if (GameManager.playernumber != 1) { Rigidbody2D[] rbChildren = GetComponentsInChildren <Rigidbody2D>(); foreach (Rigidbody2D RBCHILDREN in rbChildren) { RBCHILDREN.isKinematic = true; RBCHILDREN.gravityScale = 0; } } if (MenuController.selectedgamemode == 4) { maxHealth += 100; } }