예제 #1
0
 /// <summary>Changes the state of each effector to unactive.</summary>
 /// <remarks>Changes the state of each effector to unactive. The effect results in non animated bodyparts.
 ///     </remarks>
 /// <param name="parents">indicates whether parents of the effectors have to be deactivated or not.
 ///     </param>
 public virtual void deactivateEffectors(SpriterAbstractPlayer player, bool parents)
 {
     foreach (SpriterIKObject key in this.ikMap.Keys)
     {
         SpriterAbstractObject obj = this.ikMap[key];
         if (obj is SpriterBone)
         {
             obj = player.getRuntimeBones()[obj.getId()];
         }
         else
         {
             obj = player.getRuntimeObjects()[obj.getId()];
         }
         obj.active = false;
         if (!parents)
         {
             continue;
         }
         SpriterBone par = (SpriterBone)obj.getParent();
         for (int j = 0; j < key.chainLength && par != null; j++)
         {
             player.getRuntimeBones()[par.getId()].active = false;
             par = (SpriterBone)par.getParent();
         }
     }
 }