// Use this for initialization void Start() { if (instance == null) { instance = this; } }
public void TakeDamage(float amt) { health -= amt; DamageFlash.Flash(); AudioSource.PlayClipAtPoint(hurtClip, transform.position); if (health <= 0) { // TODO: Death animation? PlayerPrefs.SetInt("Victory", 0); Application.LoadLevel("gameOver"); } }
void Start() { Time.timeScale = 1f; damage_camera = GetComponent <DamageFlash>(); damage_camera.UpdateDamage(health); AudioManager.SetAmbience(AmbienceType.ABOVE); last_pos = transform.position; cam_follow_target = transform.Find("Camera Follow Target"); cam_lookat_target = transform.Find("Camera Look Target"); SetFlightMode(FlightMode.HIGH, false); transform.position = new Vector3(transform.position.x, high_altitude, transform.position.z); }
// Use this for initialization private void Start() { hittimer = 0; lives = game_settings.playerLives - 1; m_CharacterController = GetComponent <CharacterController>(); ani = GetComponentInChildren <ResetPostion>().GetComponent <Animator>(); m_Camera = GetComponentInChildren <Camera>(); m_OriginalCameraPosition = m_Camera.transform.localPosition; m_FovKick.Setup(m_Camera); m_HeadBob.Setup(m_Camera, m_StepInterval); m_StepCycle = 0f; m_NextStep = m_StepCycle / 2f; m_Jumping = false; m_AudioSource = GetComponent <AudioSource>(); m_MouseLook.Init(transform, m_Camera.transform); weapon = GetComponentInChildren <WeaponStats>(); damageFlash = (DamageFlash)GetComponent(typeof(DamageFlash)); healFlash = (HealFlash)GetComponent(typeof(HealFlash)); attackSoundPlay = true; //Healthbar = GetComponentInChildren<Slider>(); }
public void Awake() { flasher = GetComponent <DamageFlash>(); }
private void Awake() { controller = GetComponent <PlayerController>(); weaponController = GetComponent <WeaponController>(); damageFlash = GetComponentInChildren <DamageFlash>(); }
private void Start() { sRender = GetComponent <SpriteRenderer>(); damageFlash = GetComponent <DamageFlash>(); }
// Use this for initialization void Start() { if(instance==null) { instance = this; } }