private float armor; //Current armor will be stored here // Use this for initialization void Start() { if (!isLocalPlayer) { return; } GameObject.Find("Main Camera").GetComponent <JustinCameraFollow> ().target = gameObject.transform; health = maxHealth; armor = 0; score = GameObject.Find("Highscore").GetComponent <JustinHighscore>(); JustinReference r = GameObject.Find("ReferencePoint").GetComponent <JustinReference>(); mainGame = r.mainMenu; gameOver = r.gameOver; if (GameObject.Find("Player(Clone)") != null) { gameOver = r.gameOverNetwork; } if (transform.gameObject.tag == "Player") { healthDisplay = GameObject.Find("Green Health Bar").GetComponent <JustinHealthBar>(); } if (healthDisplay != null) { healthDisplay.maxHealth = maxHealth; healthDisplay.currentHealth = health; } }
private bool canDoubleJump = true; //Whether or not the player can double jump // Use this for initialization void Start() { thePlayer = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); weaponManager = GetComponent <JustinPlayerWeaponsNN>(); facingRight = true; JustinReference r = GameObject.Find("ReferencePoint").GetComponent <JustinReference>(); mainGame = r.mainMenu; gameOver = r.gameOver; }
private SpriteRenderer rend; //The sprite renderer of the player // Use this for initialization void Start() { rend = GetComponent <SpriteRenderer>(); if (!isLocalPlayer) { Color rC = rend.material.color; rend.material.color = new Color(rC.r, rC.g, rC.b, 0.5f); return; } thePlayer = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); weaponManager = GetComponent <JustinPlayerWeapons>(); facingRight = true; JustinReference r = GameObject.Find("ReferencePoint").GetComponent <JustinReference>(); mainGame = r.mainMenu; gameOver = r.gameOverNetwork; }
private float armor; //Current armor will be stored here // Use this for initialization void Start() { health = maxHealth; armor = 0; score = GameObject.Find("Highscore").GetComponent <JustinHighscore>(); JustinReference r = GameObject.Find("ReferencePoint").GetComponent <JustinReference>(); mainGame = r.mainMenu; gameOver = r.gameOver; if (transform.gameObject.tag == "Player") { PlayerPrefs.SetInt("Kills", 0); healthDisplay = GameObject.Find("Green Health Bar").GetComponent <JustinHealthBar>(); } if (healthDisplay != null) { healthDisplay.maxHealth = maxHealth; healthDisplay.currentHealth = health; } }