Exemple #1
0
    void Start()
    {
        OnEnter();
        a_itemuse   itemuse   = new a_itemuse();
        a_movepoint movepoint = new a_movepoint();
        a_movediff  movediff  = new a_movediff();
        a_moveenter moveenter = new a_moveenter();
        a_moveleave moveleave = new a_moveleave();
        a_attack    attack    = new a_attack();
        a_gatekick  kick      = new a_gatekick();

        Register(itemuse, ack_itemuse);
        Register(movepoint, ack_movepoint);
        Register(movediff, ack_movediff);
        Register(moveenter, ack_moveenter);
        Register(moveleave, ack_moveleave);
        Register(attack, ack_attack);
        Register(kick, ack_gatekick);
    }
Exemple #2
0
    void ack_attack(int err, wire o)
    {
        a_attack ack    = (a_attack)o;
        var      atk    = EntityManager.GetCharacter(ack.attacker);
        var      target = EntityManager.GetCharacter(ack.target);

        if (atk == null || target == null)
        {
            return;
        }
        GameObject obj    = Tool.InstancePrefab("Effect/EffectAtk");
        EffectAtk  effect = obj.GetComponent <EffectAtk>();

        effect.SRC = atk.gameObject;
        effect.DST = target.gameObject;
        effect.Fire();
        target.HP = ack.targethp;
        Debug.Log("TargetHP:" + target.HP);
        return;
    }