public void resetColdHP() { this.coldHp = 100; if (GameManager.instance != null) { GameManager.instance.coldHp = 100; } coldControl.setValue(this.coldHp); int stage = 9 - (this.coldHp / 10); frostEffect.setFrostAmountToStage(stage); }
void Start() { characterController = GetComponent <CharacterController>(); animator = GetComponent <Animator>(); joystick = GameObject.Find("Variable Joystick").GetComponent <VariableJoystick>(); state = ActionState.Idle; camera = GameObject.Find("FirstPersonView").GetComponent <Camera>(); this.cameraOffset = Camera.main.transform.position - this.transform.position; hpControl = (HealthBarControl)GameObject.FindGameObjectWithTag("HPBar").GetComponent(typeof(HealthBarControl)); coldControl = (ManaBarControl)GameObject.FindGameObjectWithTag("ManaBar").GetComponent(typeof(ManaBarControl)); frostEffect = GameObject.Find("FirstPersonView").GetComponent <FrostEffect>(); if (GameManager.instance != null) { this.hp = GameManager.instance.hp; this.coldHp = GameManager.instance.coldHp; hpControl.setValue(this.hp); coldControl.setValue(this.coldHp); this.transform.position = GameManager.instance.position; this.transform.rotation = GameManager.instance.rotation; } Debug.Log("Start for Player: hp " + this.hp + ", coldHp: " + this.coldHp + ", position: " + this.transform.position + "instance position: " + GameManager.instance.position); }