Пример #1
0
    public float Damaged(float power, tDrop.Type damagedType)
    {
        SEPlayer.Play(damagedSE, 1.0f);
        float scale = 1f;

        if (damagedType == type || damagedType == tDrop.Type.All)
        {
            scale  = 3f;
            power *= 2f;
        }
        return(hp.Damaged(power, damagedType, transform.position + new Vector3(Random.Range(-100f, 100f), Random.Range(-100f, 100f) - 50f, 0f), scale));
    }
Пример #2
0
    /// ///////////////////////////////////////////////////    更新処理    //////////////////////////////////////////////////////

    public void PlayerDamaged(float power, tDrop.Type type)
    {
        float rate = 1f;

        foreach (var damaged in damagedUp)
        {
            rate *= damaged.rate;
        }
        SEPlayer.Play(SE.Name.DAMAGED, 0.42f);
        Vector3 pos = PlayerHP.transform.position;

        PlayerHP.Damaged(power * rate, type, new Vector3(pos.x + Random.Range(Screen.width / 5f, Screen.width / 5f * 4f), pos.y, pos.z), 3f);
    }