Exemplo n.º 1
0
        ///-------------------------------------------------------------------------
        /// <summary>GUI処理</summary>
        ///-------------------------------------------------------------------------
        public void OnGUI()
        {
            try
            {
                // 機能有効の場合
                // if( this.Enable )

                if (GizmoRender.UIVisible)
                {
                    // 補助キーの押下有無確認
                    bool isCtrl  = Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl);
                    bool isShift = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
                    bool isAlt   = Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt);

                    if (this.Enable)
                    {
                        float windowWidth = Screen.width / 4 - ControlBase.FixedMargin * 2;

                        Rect pluginPos = new Rect(Screen.width - windowWidth, Screen.height / 15 + ControlBase.FixedMargin, Screen.width / 5 - Screen.width / 65, Screen.height - Screen.height / 5);

                        if (selectedMode == ConstantValues.EditMode.Movie)
                        {
                            this.timelineWindow.Width          = 1000;
                            this.timelineWindow.Height         = 800;
                            this.timelineWindow.rectGui.width  = 1000;
                            this.timelineWindow.rectGui.height = 800;
                            this.timelineWindow.OnGUI();
                        }

                        GlobalCurveWindow.Update();
                        GlobalComponentPicker.Update();
                        GlobalPropertyPicker.Update();
                        GlobalComboBox.Update();
                    }
                    else
                    {
                        // 補助キーを押下していない場合
                        bool isEnableControl = (isCtrl == false && isShift == false && isAlt == false);
                        GameMain.Instance.MainCamera.SetControl(isEnableControl);
                        UICamera.InputEnable = isEnableControl;
                    }
                }
                // else
                // {
                //     GameMain.Instance.MainCamera.SetControl( true );
                //     UICamera.InputEnable = true;
                // }
            }
            catch (Exception e)
            {
                Debug.LogError(e.ToString());
            }
        }
            public void Set(Vector2 p, float fWidth, int iFontSize, AnimationCurve _curve, Action <AnimationCurve> f)
            {
                rect      = new Rect(p.x - fWidth, p.y, fWidth, 0f);
                fRightPos = p.x + fWidth;
                fUpPos    = p.y;

                gsLabel.fontSize  = iFontSize;
                gsButton.fontSize = iFontSize;
                gsText.fontSize   = iFontSize;

                fMargin = iFontSize * 0.3f;

                func = f;

                curve = _curve;

                keys = new Keyframe[_curve.keys.Length];
                for (int i = 0; i < keys.Length; i++)
                {
                    keys[i] = _curve.keys[i];
                }
                keys[0] = _curve.keys[0];
                keys[keys.Length - 1] = _curve.keys[keys.Length - 1];

                fCurve = new float[keys.Length * 2];
                for (int i = 0; i < keys.Length; i++)
                {
                    fCurve[i * 2]     = keys[i].outTangent;
                    fCurve[i * 2 + 1] = keys[i].value;
                }

                sValues[0] = keys[0].outTangent.ToString();
                sValues[1] = keys[0].value.ToString();
                sValues[2] = keys[keys.Length - 1].inTangent.ToString();
                sValues[3] = keys[keys.Length - 1].value.ToString();

                texture = GlobalCurveWindow.CreateCurveTexture(curve, false);

                show    = true;
                changed = true;
            }
 private void CreateCurve()
 {
     curve   = new AnimationCurve(keys);
     texture = GlobalCurveWindow.CreateCurveTexture(curve, false);
 }