Beispiel #1
0
        public void Play()
        {
            animationState = FtueAnimationState.Playing;

            FtueAnimationStep currentStep = CurrentSequence[currentStepNumber];

            Log.Debug(string.Format("Playing animation #{0} - {1} for {2}.", currentStepNumber, currentStep.Clip, currentStep.Agent));

            PlayClip(currentStep);
        }
Beispiel #2
0
        protected void OnFtueAnimationCompleteHandler(object sender, FtueAgentAnimationEvent eventArgs)
        {
            // setting state
            animationState = FtueAnimationState.Waiting;

            // getting the completed step
            FtueAnimationStep completedStep = CurrentSequence[currentStepNumber];

            // incrementing the event number
            currentStepNumber++;

            // checking if there are next steps
            if (currentStepNumber < CurrentSequence.Count)
            {
                if (completedStep.AutoPlay)
                {
                    if (OnFtueAnimationClipComplete != null)
                    {
                        OnFtueAnimationClipComplete(new FtueAgentAnimationEvent(completedStep.Agent, -1, completedStep.Clip));
                    }

                    if (!IsErrorState)
                    {
                        Play();
                    }
                }
                else
                {
                    if (OnFtueAnimationWaiting != null)
                    {
                        OnFtueAnimationWaiting(new FtueAgentAnimationEvent(completedStep.Agent, -1, completedStep.Clip));
                    }
                }
            }
            else
            {
                // dispatching the event
                if (OnFtueAnimationSequenceComplete != null)
                {
                    OnFtueAnimationSequenceComplete(ftueType);
                }
            }
        }