Exemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            OutPile      outPile = target as OutPile;
            ThrowOutCard trans   = EditorGUILayout.ObjectField(new GUIContent("打出的那张牌所在"), outPile.OutCard, typeof(ThrowOutCard), true) as ThrowOutCard;
            MahjongItem  item    = EditorGUILayout.ObjectField(new GUIContent("最后打出的牌:"), outPile.OutCard.ThrowCard, typeof(MahjongItem), true) as MahjongItem;

            if (!trans.Equals(outPile.OutCard))
            {
                outPile.OutCard = trans;
            }
            float scaleX = EditorGUILayout.FloatField("打出牌横向倍数:", outPile.OutCardScaleX);
            float scaleY = EditorGUILayout.FloatField("打出牌纵向倍数:", outPile.OutCardScaleY);

            if (!outPile.OutCardScaleX.Equals(scaleX))
            {
                outPile.OutCardScaleX = scaleX;
            }
            if (!outPile.OutCardScaleY.Equals(scaleY))
            {
                outPile.OutCardScaleY = scaleY;
            }
            if (item == null)
            {
                outPile.OutCard.ThrowCard = null;
            }
            else if (!item.Equals(outPile.OutCard.ThrowCard))
            {
                outPile.OutCard.ThrowCard = item;
            }
            serializedObject.ApplyModifiedProperties();
        }
Exemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            OutPile      outPile = target as OutPile;
            ThrowOutCard trans   = EditorGUILayout.ObjectField(new GUIContent("打出的那张牌所在"), outPile.OutCard, typeof(ThrowOutCard), true) as ThrowOutCard;

            if (!trans.Equals(outPile.OutCard))
            {
                outPile.OutCard = trans;
            }
            float   scaleX          = EditorGUILayout.FloatField("打出牌横向倍数:", outPile.OutCardScaleX);
            float   scaleY          = EditorGUILayout.FloatField("打出牌纵向倍数:", outPile.OutCardScaleY);
            bool    isFlyShowVoice  = EditorGUILayout.Toggle("是否在飞到显示的位置显示声音:", outPile.FlyShowVoice);
            bool    isDownShowVoice = EditorGUILayout.Toggle("是否在落到牌堆时显示声音:", outPile.DownShowVoice);
            bool    isDirectLie     = EditorGUILayout.Toggle("打出牌后是否直接放倒:", outPile.DirectLie);
            Vector3 twPos           = EditorGUILayout.Vector3Field("二人场打出牌堆本地位置:", outPile.TwoPeoplePos);

            if (!outPile.OutCardScaleX.Equals(scaleX))
            {
                outPile.OutCardScaleX = scaleX;
            }
            if (!outPile.OutCardScaleY.Equals(scaleY))
            {
                outPile.OutCardScaleY = scaleY;
            }
            if (!outPile.FlyShowVoice.Equals(isFlyShowVoice))
            {
                outPile.FlyShowVoice = isFlyShowVoice;
            }
            if (!outPile.DownShowVoice.Equals(isDownShowVoice))
            {
                outPile.DownShowVoice = isDownShowVoice;
            }
            if (!outPile.DirectLie.Equals(isDirectLie))
            {
                outPile.DirectLie = isDirectLie;
            }
            if (!outPile.TwoPeoplePos.Equals(twPos))
            {
                outPile.TwoPeoplePos = twPos;
            }
            serializedObject.ApplyModifiedProperties();
        }