Beispiel #1
0
 public void StopCapture()
 {
     captureTrigger.SetActive(false);
     for (int i = capturedObjects.Count - 1; i >= 0; i--)
     {
         Creature creature = capturedObjects[i].ragdollPart.ragdoll.creature;
         if (creature.GetComponent <IceSpellMWE>())
         {
             IceSpellMWE scr = creature.GetComponent <IceSpellMWE>();
             scr.UnFreezeCreature(creature);
         }
         capturedObjects.RemoveAt(i);
     }
     UnityEngine.Object.Destroy(captureTrigger.gameObject);
 }
Beispiel #2
0
 protected void OnTrigger(Collider other, bool enter)
 {
     if (other.attachedRigidbody && !other.attachedRigidbody.isKinematic)
     {
         CollisionHandler component = other.attachedRigidbody.GetComponent <CollisionHandler>();
         if (component && component.ragdollPart && component.ragdollPart.ragdoll != mana.creature.ragdoll && bubbleActive)
         {
             if (enter)
             {
                 Creature creature = component.ragdollPart.ragdoll.creature;
                 if (creature != Player.currentCreature && !creature.isKilled)
                 {
                     if (creature.ragdoll.state != Ragdoll.State.Frozen)
                     {
                         if (!creature.GetComponent <IceSpellMWE>())
                         {
                             creature.gameObject.AddComponent <IceSpellMWE>();
                         }
                         IceSpellMWE scr = creature.GetComponent <IceSpellMWE>();
                         scr.SlowStartCoroutine(creature, 100f, 0f, 0f, 50f);
                     }
                 }
                 capturedObjects.Add(component);
                 return;
             }
             else
             {
                 Creature creature = component.ragdollPart.ragdoll.creature;
                 if (creature.GetComponent <IceSpellMWE>())
                 {
                     IceSpellMWE scr = creature.GetComponent <IceSpellMWE>();
                     scr.UnFreezeCreature(creature);
                 }
                 capturedObjects.Remove(component);
             }
         }
     }
 }