/// <summary>
    /// CREO QUE NUNCA SE TRIGGEREA PORQUE SE DESTRUYEN LOS COLLIDERS Y OBJETOS DE MINA, ETC ANTES DE DETECTAR EL EXIT
    /// </summary>
    /// <param name="source"></param>
    public void OnEffectExit(IEffectSource source)
    {
        if (source.owner != gameObject)
        {
            switch (source.type)
            {
            case EffectType.MOO_MINE:
                if (boxInPossession)
                {
                    // tirar aloomonite 2 segundos mas
                }
                else
                {
                    // incapacitar para actuar 2 segundos mas
                }
                break;

            case EffectType.BLACK_HOLE:

                break;

            case EffectType.STUN:
                // ¿nada?
                break;

            default:
                break;
            }
        }
    }
Beispiel #2
0
    public Effect CloneInitializedToSource(IEffectSource source)
    {
        Effect clone = Clone();

        clone.source = source;
        clone.Initialize();
        return(clone);
    }
Beispiel #3
0
 //Will Remove all effects from a given source
 public void RemoveEffectsFromSource(IEffectSource source, bool triggerOnLeaveEffect)
 {
     for (int i = 0; i < existingEffects.Count; i++)
     {
         if (existingEffects[i].source == source)
         {
             if (triggerOnLeaveEffect && existingEffects[i]._onLeaveEffect != null)
             {
                 existingEffects[i]._onLeaveEffect(this);
             }
             existingEffects.RemoveAt(i);
         }
     }
 }
    public void OnEffectEnter(IEffectSource source)
    {
        if (source.owner != gameObject)  // La idea es saber si soy o no el owner para que no me afecte mi propia mina o efecto
        {
            switch (source.type)
            {
            case EffectType.MOO_MINE:
                if (boxInPossession)
                {
                    // tirar aloomonite
                }
                else
                {
                    // incapacitar para actuar
                }
                break;

            case EffectType.BLACK_HOLE:
                //if (source.owner == gameObject) { // La idea es saber si soy o no el owner para que no me afecte mi propia mina
                //Debug.Log("En blackhole");
                if (boxInPossession)
                {
                    CmdDropInventoryBox();
                }
                //preventInteraction = true;
                transform.position = Vector3.MoveTowards(transform.position, source.GetGameObject().transform.position, attractionSpeed * Time.deltaTime);
                //}
                break;

            case EffectType.STUN:
                // animacion de stun
                // bloquear movimiento
                break;

            default:
                break;
            }
        }
    }