Exemplo n.º 1
0
        public void StartAnim(GameSceneObject obj, String animationName)
        {
            //bool used = false;
            int id = 0;

            for (int animi = 0; animi < RunningAnimations.Count; animi++) // looking for animaction in list
            {
                if ((GameSceneObject)(RunningAnimations[animi].activator) == obj) // pokud uz je v seznamu
                    if (RunningAnimations[animi].animState.AnimationName == animationName)
                    {
                        //used = true;
                        id = animi;
                        break;
                    }
            }

            /*
            if (used) // pokud jsme uz objekt animovali
            {
                ObjectAnimation anim = new ObjectAnimation(mMgr.GetEntity("entity" + obj.Id).GetAnimationState(animationName), obj);
                anim.animState.Enabled = true;
                RunningAnimations[id] = anim;
            }

            if (!used && obj != null) // pokud jeste ne, pricdame
            {
                ObjectAnimation anim = new ObjectAnimation(mMgr.GetEntity("entity" + obj.Id).GetAnimationState(animationName), obj);
                anim.animState.Enabled = true;
                RunningAnimations.Add(anim);
            }
             * */
        }
Exemplo n.º 2
0
 public GameObjectAnimation(AnimationState state, GameSceneObject act)
 {
     this.animState = state;
     this.activator = act;
 }
Exemplo n.º 3
0
 //zastavi animaci
 public void StopAnim(GameSceneObject ent, String animationName)
 {
     for (int animi = 0; animi < RunningAnimations.Count; animi++) // najdeme animaci v seznamu podle objektu
     {
         if ((GameSceneObject)(RunningAnimations[animi].activator) == ent)
             if (RunningAnimations[animi].animState.AnimationName == animationName)
             {
                 //TODO: kdyz smazu objekt a zustane tady, tak to hapa
                 if (RunningAnimations[animi].animState != null)
                     RunningAnimations[animi].animState.Enabled = false; // a vypneme ji
             }
     }
     RunningAnimations.Clear();
 }