示例#1
0
        /// Draw the "Play" button.
        private void DrawPlay()
        {
            Rect       playRect;
            GUIContent playContent;


            SetupButton_Play(out playRect, out playContent);
            if (Controls.Button(playRect, playContent))
            {
                if (!Application.isPlaying)
                {
                    var sceneWindow = (SceneView)GetWindow(typeof(SceneView));
                    sceneWindow.ShowNotification(new GUIContent("To play an animation you must be in Play mode."));
                }
                else
                {
                    if (_currentAnimatablesIndex < _animators.Count)
                    {
                        AnimatorHandler.PlayAnimation(_animators[_currentAnimatablesIndex], _animatableClips[_currentClipIndex]);
                    }
                    else
                    {
                        AnimationHandler.PlayAnimation(_animations[_currentAnimatablesIndex - _animators.Count], _animatableClips[_currentClipIndex]);
                    }
                }
            }
        }