Пример #1
0
    void Awake()
    {
        Animation = GetComponent <BioAnimation_APFNN>();
        CW        = new Queue <float> [Animation.APFNN.ControlWeights];
        for (int i = 0; i < CW.Length; i++)
        {
            CW[i] = new Queue <float>();
            for (int j = 0; j < Frames; j++)
            {
                CW[i].Enqueue(0f);
            }
        }
        Skeleton.onClick.AddListener(ToggleSkeleton); UpdateColor(Skeleton, Animation.Character.DrawSkeleton ? VisualisationEnabled : VisualisationDisabled);
        Transforms.onClick.AddListener(ToggleTransforms); UpdateColor(Transforms, Animation.Character.DrawTransforms ? VisualisationEnabled : VisualisationDisabled);
        Velocities.onClick.AddListener(ToggleVelocities); UpdateColor(Velocities, Animation.ShowVelocities ? VisualisationEnabled : VisualisationDisabled);
        Trajectory.onClick.AddListener(ToggleTrajectory); UpdateColor(Trajectory, Animation.ShowTrajectory ? VisualisationEnabled : VisualisationDisabled);
        CyclicWeights.onClick.AddListener(ToggleCyclicWeights); UpdateColor(CyclicWeights, DrawCW ? VisualisationEnabled : VisualisationDisabled);
        InverseKinematics.onClick.AddListener(ToggleInverseKinematics); UpdateColor(InverseKinematics, Animation.SolveIK ? VisualisationEnabled : VisualisationDisabled);
        MotionTrails.onClick.AddListener(ToggleMotionTrails); UpdateColor(MotionTrails, DrawTrails ? VisualisationEnabled : VisualisationDisabled);

        SmoothFollow.onClick.AddListener(SetSmoothFollow); UpdateColor(SmoothFollow, CameraController.Mode == CameraController.MODE.SmoothFollow ? CameraEnabled : CameraDisabled);
        ConstantView.onClick.AddListener(SetConstantView); UpdateColor(ConstantView, CameraController.Mode == CameraController.MODE.ConstantView ? CameraEnabled : CameraDisabled);
        Static.onClick.AddListener(SetStatic); UpdateColor(Static, CameraController.Mode == CameraController.MODE.Static ? CameraEnabled : CameraDisabled);

        Yaw.onValueChanged.AddListener(SetYaw);
        Pitch.onValueChanged.AddListener(SetPitch);
        FOV.onValueChanged.AddListener(SetFOV);

        CanvasToggle.onClick.AddListener(ToggleShow);
    }
Пример #2
0
    void OnGUI()
    {
        Utility.SetGUIColor(UltiDraw.Black);
        using (new EditorGUILayout.VerticalScope("Box")) {
            Utility.ResetGUIColor();

            Utility.SetGUIColor(UltiDraw.Grey);
            using (new EditorGUILayout.VerticalScope("Box")) {
                Utility.ResetGUIColor();

                Utility.SetGUIColor(UltiDraw.Orange);
                using (new EditorGUILayout.VerticalScope("Box")) {
                    Utility.ResetGUIColor();
                    EditorGUILayout.LabelField("Recorder");
                }

                if (!Application.isPlaying)
                {
                    EditorGUILayout.LabelField("Change into play mode to start recording.");
                    return;
                }

                Animation = (BioAnimation_APFNN)EditorGUILayout.ObjectField("Animation", Animation, typeof(BioAnimation_APFNN), true);
                Name      = EditorGUILayout.TextField("Name", Name);
                FrameTime = EditorGUILayout.FloatField("Frame Time", FrameTime);

                if (Data == null)
                {
                    EditorGUILayout.LabelField("No data recorded.");
                }
                else
                {
                    EditorGUILayout.LabelField("Frames: " + Data.Frames.Length);
                }

                if (Utility.GUIButton(Recording ? "Stop" : "Start", Recording ? UltiDraw.DarkRed : UltiDraw.DarkGreen, UltiDraw.White))
                {
                    Recording = !Recording;
                    if (Recording)
                    {
                        Animation.StartCoroutine(Record());
                    }
                }

                if (Utility.GUIButton("Save", UltiDraw.DarkGrey, UltiDraw.White))
                {
                    Save();
                }
            }
        }
    }
Пример #3
0
 void Awake()
 {
     Target = (BioAnimation_APFNN)target;
 }