Exemplo n.º 1
0
 public void UpdateMagnitude(PhysicsEffect effect)
 {
     if (currentEffects.ContainsKey(effect))
     {
         TrackedEffect effectInfo = currentEffects[effect];
         effect.ApplyEffect(effectInfo.hitInfo); // does not work for field shapes
     }
 }
Exemplo n.º 2
0
 // Add effect to player
 public void AddEffect(RaycastHit hitInfo, PhysicsEffect effect, GameObject player)
 {
     //Debug.Log("Effect: " + effect);
     //Does not work for Fields
     if (!currentEffects.ContainsKey(effect))
     {
         if (!effect.isOneShotEffect)
         {
             currentEffects.Add(effect, new TrackedEffect(effect, hitInfo));
             effect.AddEffectedObj(this);
         }
         effect.ApplyEffect(hitInfo, player);
     }
 }
Exemplo n.º 3
0
    public void AddEffect(RaycastHit hitInfo, PhysicsEffect effect)
    {
        //TODO prevents exact same effect from being added, but later we should make it so
        //if an updated version of an effect type is added, the original is removed etc.

        //Debug.Log("Effect: " + effect);
        //Does not work for Fields
        if (!currentEffects.ContainsKey(effect))
        {
            if (!effect.isOneShotEffect)
            {
                currentEffects.Add(effect, new TrackedEffect(effect, hitInfo));
                effect.AddEffectedObj(this);
            }
            effect.ApplyEffect(hitInfo);
        }
    }