public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        BCEditorTools.SetLabelWidth(120f);

        BCTweenColor tw = target as BCTweenColor;

        GUI.changed = false;

        Color from = EditorGUILayout.ColorField("From", tw.from);
        Color to   = EditorGUILayout.ColorField("To", tw.to);

        tw.UGUIMode = EditorGUILayout.Toggle("UGUI Mode", tw.UGUIMode);
        if (tw.UGUIMode)
        {
            DrawDefaultInspector();
        }

        if (GUI.changed)
        {
            BCEditorTools.RegisterUndo("Tween Change", tw);
            tw.from = from;
            tw.to   = to;
            BCEditorTools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
 public override void OnInspectorGUI()
 {
     GUILayout.Space(6f);
     BCEditorTools.SetLabelWidth(110f);
     base.OnInspectorGUI();
     DrawCommonProperties();
 }
    public override void OnInspectorGUI()
    {
        int   textMode = 0, RealValue = 0, MaxValue = 1, percentDotNum = 0;
        float PercentValue = 0;
        bool  BeyondRich = false, NotBeyondRich = false;
        Color BeyondColor = Color.black, NotBeyondColor = Color.black;


        textMode = EditorGUILayout.Popup("Text Mode", _target.textMode, TEXTMODE);
        if (textMode == 0)
        {
            RealValue = EditorGUILayout.IntField("Real Value", _target.RealValue);
            MaxValue  = EditorGUILayout.IntField("Max Value", _target.MaxValue);
        }
        else if (textMode == 1)
        {
            percentDotNum = EditorGUILayout.Popup("Percent Dot Num", _target.percentDotNum, DOTNUM);
            PercentValue  = EditorGUILayout.FloatField("Percent Value", _target.PercentValue);
        }
        BeyondRich = EditorGUILayout.Toggle("Beyond Rich", _target.BeyondRich);
        if (BeyondRich)
        {
            BeyondColor = EditorGUILayout.ColorField("Beyond Color", _target.BeyondColor);
        }
        NotBeyondRich = EditorGUILayout.Toggle("Not Beyond Rich", _target.NotBeyondRich);
        if (NotBeyondRich)
        {
            NotBeyondColor = EditorGUILayout.ColorField("Not Beyond Color", _target.NotBeyondColor);
        }


        if (GUI.changed)
        {
            BCEditorTools.RegisterUndo("UGUI Change", _target);
            _target.textMode = textMode;
            if (textMode == 0)
            {
                _target.RealValue = RealValue;
                _target.MaxValue  = MaxValue;
            }
            else if (textMode == 1)
            {
                _target.percentDotNum = percentDotNum;
                _target.PercentValue  = PercentValue;
            }
            _target.BeyondRich    = BeyondRich;
            _target.NotBeyondRich = NotBeyondRich;
            if (BeyondRich)
            {
                _target.BeyondColor = BeyondColor;
            }
            if (NotBeyondRich)
            {
                _target.NotBeyondColor = NotBeyondColor;
            }
            BCEditorTools.SetDirty(_target);
        }
        DrawDefaultInspector();
    }
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        BCEditorTools.SetLabelWidth(120f);

        BCTweenScale tw = target as BCTweenScale;

        GUI.changed = false;

        Vector3 from = EditorGUILayout.Vector3Field("From", tw.from);

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Set local From"))
        {
            from        = tw.value;
            GUI.changed = true;
        }
        if (GUILayout.Button("Reset By local From"))
        {
            tw.value = from;
        }
        EditorGUILayout.EndHorizontal();
        Vector3 to = EditorGUILayout.Vector3Field("To", tw.to);

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Set local To"))
        {
            to          = tw.value;
            GUI.changed = true;
        }
        if (GUILayout.Button("Reset By local To"))
        {
            tw.value = to;
        }
        EditorGUILayout.EndHorizontal();

        bool fromIsCurrent = EditorGUILayout.Toggle("From Is Current", tw.fromIsCurrent);
        bool RelativeScale = false;

        if (fromIsCurrent)
        {
            RelativeScale = EditorGUILayout.Toggle("->Relative Scale", tw.RelativeScale);
        }

        tw.mTrans = EditorGUILayout.ObjectField("Transform", tw.mTrans, typeof(Transform)) as Transform;

        if (GUI.changed)
        {
            BCEditorTools.RegisterUndo("Tween Change", tw);
            tw.from          = from;
            tw.to            = to;
            tw.fromIsCurrent = fromIsCurrent;
            tw.RelativeScale = RelativeScale;
            BCEditorTools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        BCEditorTools.SetLabelWidth(120f);
        BCTweenRectTranSize tw = target as BCTweenRectTranSize;

        GUI.changed = false;
        int   sizeMode = EditorGUILayout.Popup(tw.sizeMode, modeStr);
        float from     = EditorGUILayout.FloatField("From", tw.from);

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Set local From"))
        {
            from        = tw.value;
            GUI.changed = true;
        }
        if (GUILayout.Button("Reset By local From"))
        {
            tw.value = from;
        }
        EditorGUILayout.EndHorizontal();
        float to = EditorGUILayout.FloatField("To", tw.to);

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Set local To"))
        {
            to          = tw.value;
            GUI.changed = true;
        }
        if (GUILayout.Button("Reset By local To"))
        {
            tw.value = to;
        }
        EditorGUILayout.EndHorizontal();

        tw.mTran = EditorGUILayout.ObjectField("Transform", tw.mTran, typeof(RectTransform)) as RectTransform;

        if (GUI.changed)
        {
            BCEditorTools.RegisterUndo("Tween Change", tw);
            tw.sizeMode = sizeMode;
            tw.from     = from;
            tw.to       = to;
            BCEditorTools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        BCEditorTools.SetLabelWidth(120f);

        BCTweenNumText tw = target as BCTweenNumText;

        DrawDefaultInspector();
        if (tw.soundStartTime < 0)
        {
            tw.soundStartTime = 0;
        }
        if (tw.soundSkipCount < 0)
        {
            tw.soundStartTime = 0;
        }
        DrawCommonProperties();
    }
    public override void OnInspectorGUI()
    {
        BCEditorTools.SetLabelWidth(130f);
        BCSetActiveTool bt = target as BCSetActiveTool;

        bt.Reverse = EditorGUILayout.Toggle("Set Active Reverse", bt.Reverse);
        for (int i = 0; i < bt.list.Count; i++)
        {
            BCEditorTools.BeginContents();
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("-", GUILayout.Width(30)))
            {
                bt.list.RemoveAt(i);
                BCEditorTools.EndContents();
                EditorGUILayout.EndHorizontal();
                return;
            }
            GameObject go = EditorGUILayout.ObjectField(bt.list[i].go, typeof(GameObject)) as GameObject;
            EditorGUILayout.EndHorizontal();
            bool setActive = EditorGUILayout.Toggle("Set Active", bt.list[i].setActive);
            BCEditorTools.EndContents();

            if (GUI.changed)
            {
                BCEditorTools.RegisterUndo("Tween Change", bt);
                bt.list[i].go        = go;
                bt.list[i].setActive = setActive;
                BCEditorTools.SetDirty(bt);
            }
        }
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("  ", GUILayout.ExpandWidth(true));
        if (GUILayout.Button("+", GUILayout.Width(50)))
        {
            BCSetActiveTool.SetActiveData addMe = new BCSetActiveTool.SetActiveData();
            if (bt.list.Count > 0)
            {
                addMe.setActive = bt.list[bt.list.Count - 1].setActive;
            }
            bt.list.Add(addMe);
        }
        EditorGUILayout.EndHorizontal();
    }
    public override void OnInspectorGUI()
    {
        if (null == tw || null == onUpdateEvents)
        {
            init();
        }

        GUILayout.Space(6f);
        BCEditorTools.SetLabelWidth(120f);

        GUI.changed = false;

        Vector4 from = EditorGUILayout.Vector4Field("From", tw.from);
        Vector4 to   = EditorGUILayout.Vector4Field("To", tw.to);

        EditorGUILayout.Vector4Field("Value", tw.value);
        bool useUpdate = EditorGUILayout.Toggle("Use Update", tw.useUpdate);

        if (GUI.changed)
        {
            BCEditorTools.RegisterUndo("Tween Change", tw);
            tw.from      = from;
            tw.to        = to;
            tw.useUpdate = useUpdate;
            BCEditorTools.SetDirty(tw);
            GUI.changed = false;
        }

        DrawCommonProperties();
        BCEditorTools.SetLabelWidth(80f);
        if (useUpdate)
        {
            EditorGUILayout.PropertyField(onUpdateEvents);
            if (GUI.changed)
            {
                serializedObject.ApplyModifiedProperties();
                Debug.Log("GUIChanged");
            }
        }
    }
    public override void OnInspectorGUI()
    {
        if (!string.IsNullOrEmpty(bo.tip))
        {
            EditorGUILayout.LabelField(bo.tip);
        }
        GUILayout.Space(3f);
        EditorGUILayout.BeginHorizontal();
        searchstr = EditorGUILayout.TextField(searchstr);
        if (GUILayout.Button("按名搜"))
        {
            searchList.Clear();
            searchList = bo.FindObjsByName(searchstr);
        }
        if (GUILayout.Button("按描述搜"))
        {
            searchList.Clear();
            searchList = bo.FindObjsByTag(searchstr);
        }
        EditorGUILayout.EndHorizontal();
        BCEditorTools.SetLabelWidth(130f);
        for (int i = 0; i < searchList.Count; i++)
        {
            GUI.color = Color.cyan;
            BCEditorTools.BeginContents();
            GUI.color = Color.white;
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("-", GUILayout.Width(30)))
            {
                bo.objList.Remove(searchList[i]);
                searchList.RemoveAt(i);
                BCEditorTools.EndContents();
                EditorGUILayout.EndHorizontal();
                return;
            }
            Object obj = EditorGUILayout.ObjectField(searchList[i].obj, typeof(Object));
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(2f);
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("描述:", GUILayout.Width(40f));
            string str = EditorGUILayout.TextField(searchList[i].Desc);
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(1f);
            BCEditorTools.EndContents();
            if (GUI.changed)
            {
                BCEditorTools.RegisterUndo("Tween Change", bo);
                searchList[i].obj  = obj;
                searchList[i].Desc = str;
                BCEditorTools.SetDirty(bo);
            }
        }

        for (int i = 0; i < bo.objList.Count; i++)
        {
            BCEditorTools.BeginContents();
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("-", GUILayout.Width(30)))
            {
                bo.objList.RemoveAt(i);
                BCEditorTools.EndContents();
                EditorGUILayout.EndHorizontal();
                return;
            }
            Object obj = EditorGUILayout.ObjectField(bo.objList[i].obj, typeof(Object));
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(2f);
            Rect titleRect = EditorGUILayout.BeginHorizontal();
            titleRect.xMax = titleRect.xMin + 40f;
            if (Event.current.isMouse && Event.current.button == 1 && titleRect.Contains(Event.current.mousePosition))
            {
                GenericMenu menu = new GenericMenu();
                menu.AddItem(new GUIContent("Duplicate one"), false, _duplicate, bo.objList[i]);
                if (bo.objList[i].obj != null && bo.objList[i].obj is AudioClip)
                {
                    menu.AddItem(new GUIContent("Play Audio"), false, _PlayAudioClip, bo.objList[i]);
                }
                menu.ShowAsContext();
                Event.current.Use();
            }
            EditorGUILayout.LabelField("描述:", GUILayout.Width(40f));
            string str = EditorGUILayout.TextField(bo.objList[i].Desc);
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(1f);
            BCEditorTools.EndContents();

            if (GUI.changed)
            {
                BCEditorTools.RegisterUndo("Tween Change", bo);
                bo.objList[i].obj  = obj;
                bo.objList[i].Desc = str;
                BCEditorTools.SetDirty(bo);
            }
        }
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("  ", GUILayout.ExpandWidth(true));
        if (GUILayout.Button("+", GUILayout.Width(50)))
        {
            BCDicOfObj.ObjData addMe = new BCDicOfObj.ObjData();
            bo.objList.Add(addMe);
        }
        EditorGUILayout.EndHorizontal();
    }
Esempio n. 10
0
 void _PlayAudioClip(object node)
 {
     BCDicOfObj.ObjData n = node as BCDicOfObj.ObjData;
     BCEditorTools.PlayClip(n.obj as AudioClip);
 }
Esempio n. 11
0
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        BCEditorTools.SetLabelWidth(120f);

        BCTweenRotation tw = target as BCTweenRotation;

        GUI.changed = false;

        Vector3 from = EditorGUILayout.Vector3Field("From", tw.from);

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Set local From"))
        {
            from        = tw.mTrans.localEulerAngles;
            GUI.changed = true;
        }
        if (GUILayout.Button("Reset By local From"))
        {
            tw.mTrans.localEulerAngles = from;
        }
        EditorGUILayout.EndHorizontal();
        Vector3 to = EditorGUILayout.Vector3Field("To", tw.to);

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Set local To"))
        {
            to          = tw.mTrans.localEulerAngles;
            GUI.changed = true;
        }
        if (GUILayout.Button("Reset By local To"))
        {
            tw.mTrans.localEulerAngles = to;
        }
        EditorGUILayout.EndHorizontal();

        bool fromIsCurrent  = EditorGUILayout.Toggle("From Is Current", tw.fromIsCurrent);
        bool RelativeRotate = false;

        if (fromIsCurrent)
        {
            RelativeRotate = EditorGUILayout.Toggle("->Relative Rotate", tw.RelativeRotate);
        }

        tw.mTrans = EditorGUILayout.ObjectField("Transform", tw.mTrans, typeof(Transform)) as Transform;
        bool Line_2D_to_3D = EditorGUILayout.Toggle("Line 2D to 3D", tw.Line_2D_to_3D);

        if (Line_2D_to_3D)
        {
            tw.leftLine  = EditorGUILayout.ObjectField("Left Line", tw.leftLine, typeof(Transform)) as Transform;
            tw.rightLine = EditorGUILayout.ObjectField("Left Line", tw.rightLine, typeof(Transform)) as Transform;
        }


        if (GUI.changed)
        {
            BCEditorTools.RegisterUndo("Tween Change", tw);
            tw.from           = from;
            tw.to             = to;
            tw.fromIsCurrent  = fromIsCurrent;
            tw.RelativeRotate = RelativeRotate;
            tw.Line_2D_to_3D  = Line_2D_to_3D;
            BCEditorTools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
Esempio n. 12
0
    public override void OnInspectorGUI()
    {
        BCEditorTools.SetLabelWidth(95f);
        _target.randMaker = (BCRandomMaker)EditorGUILayout.ObjectField("Random Maker", _target.randMaker, typeof(BCRandomMaker));
        GUILayout.Space(5f);
        _target.durationRule = (BCTweenRandTrigger.TweenTimeRule)EditorGUILayout.EnumPopup("Duration", _target.durationRule);
        if (_target.durationRule == BCTweenRandTrigger.TweenTimeRule.ConstValue)
        {
            _target.duration = EditorGUILayout.FloatField("-> value", _target.duration);
        }
        else
        {
            _target.ruleTagDuration = EditorGUILayout.TextField("-> Tag", _target.ruleTagDuration);
        }
        _target.delayRule = (BCTweenRandTrigger.TweenTimeRule)EditorGUILayout.EnumPopup("Start Delay", _target.delayRule);
        if (_target.delayRule == BCTweenRandTrigger.TweenTimeRule.ConstValue)
        {
            _target.delay = EditorGUILayout.FloatField("-> value", _target.delay);
        }
        else
        {
            _target.ruleTagDelay = EditorGUILayout.TextField("-> Tag", _target.ruleTagDelay);
        }
        GUILayout.Space(5f);

        if (BCEditorTools.DrawHeader("Tween Transfrom"))
        {
            BCEditorTools.BeginContents();
            BCEditorTools.SetLabelWidth(110f);


            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("From", GUILayout.Width(40));
            BCEditorTools.BeginContents();
            EditorGUILayout.BeginVertical();
            _target.from_rule[0] = (BCTweenRandTrigger.TweenFromRule)EditorGUILayout.EnumPopup(_target.from_rule[0]);
            if (_target.from_rule[0] == BCTweenRandTrigger.TweenFromRule.ConstValue)
            {
                _target.from.x = EditorGUILayout.FloatField(_target.from.x);
            }
            else if (_target.from_rule[0] == BCTweenRandTrigger.TweenFromRule.RandValue)
            {
                BCEditorTools.SetLabelWidth(30f);
                _target.ruleTagFrom[0] = EditorGUILayout.TextField("Tag", _target.ruleTagFrom[0]);
                BCEditorTools.SetLabelWidth(110f);
            }
            EditorGUILayout.EndVertical();
            BCEditorTools.EndContents();
            BCEditorTools.BeginContents();
            EditorGUILayout.BeginVertical();
            _target.from_rule[1] = (BCTweenRandTrigger.TweenFromRule)EditorGUILayout.EnumPopup(_target.from_rule[1]);
            if (_target.from_rule[1] == BCTweenRandTrigger.TweenFromRule.ConstValue)
            {
                _target.from.y = EditorGUILayout.FloatField(_target.from.y);
            }
            else if (_target.from_rule[1] == BCTweenRandTrigger.TweenFromRule.RandValue)
            {
                BCEditorTools.SetLabelWidth(30f);
                _target.ruleTagFrom[1] = EditorGUILayout.TextField("Tag", _target.ruleTagFrom[1]);
                BCEditorTools.SetLabelWidth(110f);
            }
            EditorGUILayout.EndVertical();
            BCEditorTools.EndContents();
            BCEditorTools.BeginContents();
            EditorGUILayout.BeginVertical();
            _target.from_rule[2] = (BCTweenRandTrigger.TweenFromRule)EditorGUILayout.EnumPopup(_target.from_rule[2]);
            if (_target.from_rule[2] == BCTweenRandTrigger.TweenFromRule.ConstValue)
            {
                _target.from.z = EditorGUILayout.FloatField(_target.from.z);
            }
            else if (_target.from_rule[2] == BCTweenRandTrigger.TweenFromRule.RandValue)
            {
                BCEditorTools.SetLabelWidth(30f);
                _target.ruleTagFrom[2] = EditorGUILayout.TextField("Tag", _target.ruleTagFrom[2]);
                BCEditorTools.SetLabelWidth(110f);
            }
            EditorGUILayout.EndVertical();
            BCEditorTools.EndContents();
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(10);
            //----------------------------------------------------------
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("To", GUILayout.Width(40));
            BCEditorTools.BeginContents();
            EditorGUILayout.BeginVertical();
            _target.to_rule[0] = (BCTweenRandTrigger.TweenToRule)EditorGUILayout.EnumPopup(_target.to_rule[0]);
            if (_target.to_rule[0] == BCTweenRandTrigger.TweenToRule.ConstValue)
            {
                _target.to.x = EditorGUILayout.FloatField(_target.to.x);
            }
            else
            {
                BCEditorTools.SetLabelWidth(30f);
                _target.ruleTagTo[0] = EditorGUILayout.TextField("Tag", _target.ruleTagTo[0]);
                BCEditorTools.SetLabelWidth(110f);
            }
            EditorGUILayout.EndVertical();
            BCEditorTools.EndContents();
            BCEditorTools.BeginContents();
            EditorGUILayout.BeginVertical();
            _target.to_rule[1] = (BCTweenRandTrigger.TweenToRule)EditorGUILayout.EnumPopup(_target.to_rule[1]);
            if (_target.to_rule[1] == BCTweenRandTrigger.TweenToRule.ConstValue)
            {
                _target.to.y = EditorGUILayout.FloatField(_target.to.y);
            }
            else
            {
                BCEditorTools.SetLabelWidth(30f);
                _target.ruleTagTo[1] = EditorGUILayout.TextField("Tag", _target.ruleTagTo[1]);
                BCEditorTools.SetLabelWidth(110f);
            }
            EditorGUILayout.EndVertical();
            BCEditorTools.EndContents();
            BCEditorTools.BeginContents();
            EditorGUILayout.BeginVertical();
            _target.to_rule[2] = (BCTweenRandTrigger.TweenToRule)EditorGUILayout.EnumPopup(_target.to_rule[2]);
            if (_target.to_rule[2] == BCTweenRandTrigger.TweenToRule.ConstValue)
            {
                _target.to.z = EditorGUILayout.FloatField(_target.to.z);
            }
            else
            {
                BCEditorTools.SetLabelWidth(30f);
                _target.ruleTagTo[2] = EditorGUILayout.TextField("Tag", _target.ruleTagTo[2]);
                BCEditorTools.SetLabelWidth(110f);
            }
            EditorGUILayout.EndVertical();
            BCEditorTools.EndContents();
            EditorGUILayout.EndHorizontal();

            BCEditorTools.EndContents();
        }
    }
    protected void DrawCommonProperties()
    {
        if (null == tw || null == onFinished || null == onWePointed1)
        {
            init();
        }

        if (Application.isPlaying)
        {
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("PlayForward"))
            {
                tw.PlayForward();
            }
            if (GUILayout.Button("PlayReverse"))
            {
                tw.PlayReverse();
            }
            if (GUILayout.Button("PlayForwardForce"))
            {
                tw.PlayForwardForce();
            }
            if (GUILayout.Button("PlayReverseForce"))
            {
                tw.PlayReverseForce();
            }
            if (GUILayout.Button("Stop"))
            {
                tw.Stop();
            }
            EditorGUILayout.EndHorizontal();
        }
        else
        {
            EditorGUILayout.HelpBox("Some buttons will appear when running.", MessageType.Info);
        }

        if (BCEditorTools.DrawHeader("Tweener"))
        {
            BCEditorTools.BeginContents();
            BCEditorTools.SetLabelWidth(110f);

            GUI.changed = false;

            BCUITweener.Style style = (BCUITweener.Style)EditorGUILayout.EnumPopup("Play Style", tw.style);

            if (style == BCUITweener.Style.Once)
            {
                GUILayout.BeginHorizontal();
                GUI.color = Color.white;
                GUILayout.EndHorizontal();
            }

            AnimationCurve curve = EditorGUILayout.CurveField("Animation Curve", tw.animationCurve, GUILayout.Width(170f), GUILayout.Height(62f));
            //UITweener.Method method = (UITweener.Method)EditorGUILayout.EnumPopup("Play Method", tw.method);

            GUILayout.BeginHorizontal();
            float dur = EditorGUILayout.FloatField("Duration", tw.duration, GUILayout.Width(170f));
            GUILayout.Label("seconds");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            float del = EditorGUILayout.FloatField("Start Delay", tw.delay, GUILayout.Width(170f));
            GUILayout.Label("seconds");
            GUILayout.EndHorizontal();

            //int tg = EditorGUILayout.IntField("Tween Group", tw.tweenGroup, GUILayout.Width(170f));
            bool ts = EditorGUILayout.Toggle("Ignore TimeScale", tw.ignoreTimeScale);

            if (GUI.changed)
            {
                BCEditorTools.RegisterUndo("Tween Change", tw);
                tw.animationCurve = curve;
                //tw.method = method;
                tw.style           = style;
                tw.ignoreTimeScale = ts;
                //tw.tweenGroup = tg;
                tw.duration = dur;
                tw.delay    = del;
                BCEditorTools.SetDirty(tw);
                GUI.changed = false;
            }
            BCEditorTools.EndContents();
        }

        BCEditorTools.SetLabelWidth(80f);
        serializedObject.Update();
        EditorGUILayout.PropertyField(onFinished);


        BCEditorTools.SetLabelWidth(120f);
        tw.EventPointsCount = EditorGUILayout.IntPopup("Events We Point", tw.EventPointsCount, chooseNumStr, chooseNum);
        if (tw.EventPointsCount > 0)
        {
            tw.tWePoint[0] = EditorGUILayout.Slider("Time We Point 1", tw.tWePoint[0], 0f, 1f);
            BCEditorTools.SetLabelWidth(80f);
            EditorGUILayout.PropertyField(onWePointed1);
        }
        BCEditorTools.SetLabelWidth(120f);
        if (tw.EventPointsCount > 1)
        {
            tw.tWePoint[1] = EditorGUILayout.Slider("Time We Point 2", tw.tWePoint[1], 0f, 1f);
            BCEditorTools.SetLabelWidth(80f);
            EditorGUILayout.PropertyField(onWePointed2);
        }
        BCEditorTools.SetLabelWidth(120f);
        if (tw.EventPointsCount > 2)
        {
            tw.tWePoint[2] = EditorGUILayout.Slider("Time We Point 3", tw.tWePoint[2], 0f, 1f);
            BCEditorTools.SetLabelWidth(80f);
            EditorGUILayout.PropertyField(onWePointed3);
        }
        serializedObject.ApplyModifiedProperties();
    }
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        BCEditorTools.SetLabelWidth(120f);

        BCTweenPosition tw = target as BCTweenPosition;

        GUI.changed = false;
        bool useTransform = EditorGUILayout.Toggle("Use Transform", tw.UseTransform);

        Vector3   from = tw.from;
        Transform fromTran = null, toTran = null;

        if (useTransform)
        {
            fromTran = EditorGUILayout.ObjectField("From", tw.fromTran, typeof(Transform)) as Transform;
        }
        else
        {
            from = EditorGUILayout.Vector3Field("From", tw.from);
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Set From"))
            {
                from        = tw.value;
                GUI.changed = true;
            }
            if (GUILayout.Button("Reset By From"))
            {
                tw.value = from;
            }
            EditorGUILayout.EndHorizontal();
        }
        Vector3 to = tw.to;

        if (useTransform)
        {
            toTran = EditorGUILayout.ObjectField("To", tw.toTran, typeof(Transform)) as Transform;
        }
        else
        {
            to = EditorGUILayout.Vector3Field("To", tw.to);
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Set To"))
            {
                to          = tw.value;
                GUI.changed = true;
            }
            if (GUILayout.Button("Reset By To"))
            {
                tw.value = to;
            }
            EditorGUILayout.EndHorizontal();
        }


        bool fromIsCurrent = false, RelativeMove = false;
        bool LockX = false, LockY = false, LockZ = false;

        if (!useTransform)
        {
            fromIsCurrent = EditorGUILayout.Toggle("From Is Current", tw.fromIsCurrent);
            if (fromIsCurrent)
            {
                RelativeMove = EditorGUILayout.Toggle("->Relative Move", tw.RelativeMove);
            }
            LockX = EditorGUILayout.Toggle("Lock X", tw.LockX);
            LockY = EditorGUILayout.Toggle("Lock Y", tw.LockY);
            LockZ = EditorGUILayout.Toggle("Lock Z", tw.LockZ);
        }

        tw.mTrans = EditorGUILayout.ObjectField("Transform", tw.mTrans, typeof(Transform)) as Transform;

        bool           UsePathCurve = EditorGUILayout.Toggle("Use Path Curve", tw.UsePathCurve);
        AnimationCurve curve        = new AnimationCurve();

        if (UsePathCurve)
        {
            curve = EditorGUILayout.CurveField("Path Curve", tw.pathCurve, GUILayout.Width(300f), GUILayout.Height(50f));
        }

        if (GUI.changed)
        {
            BCEditorTools.RegisterUndo("Tween Change", tw);
            tw.from          = from;
            tw.to            = to;
            tw.fromIsCurrent = fromIsCurrent;
            tw.RelativeMove  = RelativeMove;
            tw.LockX         = LockX;
            tw.LockY         = LockY;
            tw.LockZ         = LockZ;
            tw.UsePathCurve  = UsePathCurve;
            if (UsePathCurve)
            {
                tw.pathCurve = curve;
            }
            tw.UseTransform = useTransform;
            if (useTransform)
            {
                tw.fromTran = fromTran;
                tw.toTran   = toTran;
            }
            BCEditorTools.SetDirty(tw);
        }

        DrawCommonProperties();
    }