Esempio n. 1
0
    protected void SendEffectRemovedEvent(GameObject cause, GameObject target)
    {
        EventData data = new EventData();

        data.AddGameObject("Cause", cause);
        data.AddGameObject("Target", target);
        data.AddEffect("Effect", this);

        EventGrid.EventManager.SendEvent(Constants.GameEvent.EffectRemoved, data);
    }
Esempio n. 2
0
    private void OnStatChanged(BaseStat.StatType type, GameObject cause)
    {
        //Local Event
        UpdateNavAgent(type);

        //Global Event
        EventData data = new EventData();

        data.AddInt("Type", (int)type);
        data.AddGameObject("Target", this.gameObject);
        data.AddGameObject("Cause", cause);
        EventGrid.EventManager.SendEvent(Constants.GameEvent.StatChanged, data);
    }
Esempio n. 3
0
    public static void SendStatChangeEvent(GameObject source, GameObject target, StatType stat, float value)
    {
        EventData data = new EventData();

        data.AddGameObject("Cause", source);
        data.AddGameObject("Target", target);
        data.AddInt("Stat", (int)stat);
        data.AddFloat("Value", value);

        EventGrid.EventManager.SendEvent(Constants.GameEvent.StatChanged, data);


        Debug.Log(source.name + " has altered " + stat + " on " + target.name + " by " + value);
    }
Esempio n. 4
0
    public static void SendStatChangeEvent(GameObject source, GameObject target, StatType stat, float value)
    {
        EventData data = new EventData();

        data.AddGameObject("Cause", source);
        data.AddGameObject("Target", target);
        data.AddInt("Stat", (int)stat);
        data.AddFloat("Value", value);

        EventGrid.EventManager.SendEvent(Constants.GameEvent.StatChanged, data);

        if (stat == StatType.Health && target != null)
        {
            VisualEffectLoader.MakeFloatingText(value.ToString(), target.transform.position);

            //Debug.Log(source.name + " has altered " + stat + " on " + target.name + " by " + value);
        }
    }