Ejemplo n.º 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);
    }
Ejemplo n.º 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);
    }
Ejemplo n.º 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);
        }
    }
Ejemplo n.º 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);
        }
    }
Ejemplo n.º 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);
    }
Ejemplo n.º 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;
            }
        }
    }
Ejemplo n.º 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);
    }
Ejemplo n.º 8
0
 public void OnChangeFire(Event e)
 {
     fireCounLabel.text = BattleManager.instance.FireCount.ToString();
 }
Ejemplo n.º 9
0
    public void OnRemoveBuff(Event e)
    {
        RemoveBuffEvent ee = e as RemoveBuffEvent;

        OnBuffChanged(ee.characer);
    }
Ejemplo n.º 10
0
    public void OnAddBuff(Event e)
    {
        AddBuffEvent ee = e as AddBuffEvent;

        OnBuffChanged(ee.characer);
    }