コード例 #1
0
 private void OnDestroy( )
 {
     if (this == Instance)
     {
         Instance = null;
     }
 }
コード例 #2
0
    private void OnHurt()
    {
        AudioManager.Instance.PlaySound("playerHurt");
        ScreenshakeManager.Shake(ScreenshakeManager.EShakeType.shortSharp);

        UIManager.Instance.UpdatePlayerHealthBar(m_playerNumber, m_health.Health, m_health.MaxHealth);
        CurrentCombo = 0;
    }
コード例 #3
0
    private void Awake()
    {
        if (s_instance && s_instance != this)
        {
            Destroy(s_instance.gameObject);
        }

        s_instance = this;
    }
コード例 #4
0
    private void ProjectileHitBoss(Hurtbox _boss, Projectile _projectile)
    {
        Destroy(_projectile.gameObject);
        _boss.ApplyDamage(_projectile.m_damage);
        ScreenshakeManager.SmallShake(_projectile.m_damage);

        if (m_diamondEffect)
        {
            _boss.GetComponentInParent <BasicBoss>().ApplyDiamondEffectDebuff();
        }
    }
コード例 #5
0
 private void Awake( )
 {
     if (Instance != null && Instance != this)
     {
         Destroy(this);
     }
     else
     {
         Instance = this;
     }
 }
コード例 #6
0
    private void OnHurt()
    {
        AudioManager.Instance.PlaySound("hitBoss");
        ScreenshakeManager.Shake(ScreenshakeManager.EShakeType.small);

        float newFillAmount = Mathf.Clamp01(m_healthComp.Health / m_healthComp.MaxHealth);

        m_healthBar.FillAmount = newFillAmount;

        m_animator.SetTrigger("Damaged");
        // m_healthBar.fillAmount = newFillAmount;

        // DOTween.Kill(this);
        // DOTween.To(() => m_healthBarChase.fillAmount, x => m_healthBarChase.fillAmount = x, newFillAmount, 0.2f).SetEase(Ease.OutQuad);
    }
コード例 #7
0
    /// <summary>
    /// Updates the duration and force of the screenshake, and also returns the current force
    /// </summary>
    /// <returns></returns>
    public float UpdateShakeDurationAndGetCurrentForce(ScreenshakeManager screenshakeManager)
    {
        if (duration > 0)
        {
            duration -= Time.deltaTime;
        }
        else if (duration < 0)
        {
            duration = 0;
        }
        else if (duration == 0)
        {
            force = Mathf.Lerp(force, 0, attenuationCoeff);
        }

        return(force);
    }
コード例 #8
0
 // Use this for initialization
 void Start()
 {
     screenshake      = GameObject.Find("Main Camera").GetComponent <ScreenshakeManager>();
     cool             = 0.15f;
     gameManager      = GameObject.Find("GameManager");
     audio            = GameObject.Find("audio").GetComponent <AudioSource>();
     ani              = GetComponent <Animator>();
     bar_reload       = 0.8f;
     rand             = new Random();
     move             = new Vector3();
     walkingSpeed     = 0.2f;
     multiplier_enemy = 1;
     w = new Weapon(30f, 0.1f, 0.1f, 3, 10);
     w = new Weapon();
     if (gameObject.tag == "male")
     {
         joy = "Joy1_";
     }
     if (gameObject.tag == "female")
     {
         joy = "Joy2_";
     }
 }