Exemple #1
0
    public void OnDamage(Event e)
    {
        DamageEvent ee = e as DamageEvent;

        DamageNumItem itemPrefab = null;

        if (ee.damageInfo.isHeal)
        {
            itemPrefab = healItemPrefab;
        }
        else if (ee.damageInfo.isCrit)
        {
            itemPrefab = critItemPrefab;
        }
        else
        {
            itemPrefab = normalItemPrefab;
        }

        var item = Instantiate(itemPrefab);

        item.transform.parent     = itemPrefab.transform.parent;
        item.transform.localScale = Vector3.one;
        item.gameObject.SetActive(true);
        item.SetData(ee.receiver, (int)ee.damageInfo.damage);
        items.Add(item);
    }
Exemple #2
0
    public void OnCharacterBorn(Event e)
    {
        CharacterBornEvent   ee = e as CharacterBornEvent;
        CharacterMoveBarData d  = new CharacterMoveBarData();

        d.characer = ee.characer;
        d.pos      = 0;
        moveBarDatas.Add(d);
    }
Exemple #3
0
    public void OnRoundStart(Event e)
    {
        fireRecoverLabel.text = "+" + BattleManager.instance.FireRecovery.ToString();
        int n = BattleManager.instance.UserRoundTimes;

        for (int i = 0; i < 5; i++)
        {
            roundTimeMarks[i].SetActive(i < n - 1);
        }
    }
Exemple #4
0
    public void OnCharacterDead(Event e)
    {
        CharacterDeadEvent ee = e as CharacterDeadEvent;
        var item = items.Find(d => d.data.characer == ee.characer);

        if (item != null)
        {
            items.Remove(item);
            GameObject.Destroy(item.gameObject);
        }
    }
Exemple #5
0
    public void OnCharacterBorn(Event e)
    {
        CharacterBornEvent ee = e as CharacterBornEvent;
        var item = Instantiate(itemPrefab);

        item.transform.parent     = itemPrefab.transform.parent;
        item.transform.localScale = Vector3.one;
        item.gameObject.SetActive(true);
        item.SetData(BattleProgress.instance.GetCharacerData(ee.characer));
        items.Add(item);
    }
Exemple #6
0
    public void OnCharacterDead(Event e)
    {
        CharacterDeadEvent ee = e as CharacterDeadEvent;

        foreach (var d in moveBarDatas)
        {
            if (d.characer == ee.characer)
            {
                moveBarDatas.Remove(d);
                return;
            }
        }
    }
Exemple #7
0
    public void OnWaveStart(Event e)
    {
        string[] texts =
        {
            "一回合",
            "二回合",
            "三回合",
        };
        roundLabel.gameObject.SetActive(true);
        roundLabel.text = texts[BattleManager.instance.CurRound];
        var tween = roundLabel.GetComponent <UIPlayTween>();

        tween.Play(true);
        Invoke("HideRoundLabel", 2);
    }
Exemple #8
0
 public void OnChangeFire(Event e)
 {
     fireCounLabel.text = BattleManager.instance.FireCount.ToString();
 }
Exemple #9
0
    public void OnRemoveBuff(Event e)
    {
        RemoveBuffEvent ee = e as RemoveBuffEvent;

        OnBuffChanged(ee.characer);
    }
Exemple #10
0
    public void OnAddBuff(Event e)
    {
        AddBuffEvent ee = e as AddBuffEvent;

        OnBuffChanged(ee.characer);
    }