void Union_Field(Rect _Rect, string _MSG, Iso2DObject _obj, Color _color) { _Rect.height = EditorGUIUtility.singleLineHeight; EditorGUI.LabelField(_Rect, _MSG); _Rect.y += _Rect.height; CustomEditorGUI.Undo_Iso2DSpriteField(_Rect, _obj.sprr.sprite, Iso2DObject.GetSideListOfTileSelection(Iso2DObject.Type.Side_Union), _color); }
Iso2DObject Side_Field(Rect _Rect, Iso2DObject.Type _sideType, Color _color, GameObject _prefab) { Iso2DObject _obj = _tile_Inspector.GetSideObject(_sideType); bool _bToggle = _obj != null; _Rect.height = EditorGUIUtility.singleLineHeight; EditorGUI.BeginChangeCheck(); _bToggle = EditorGUI.ToggleLeft(_Rect, _sideType.ToString(), _bToggle); if (EditorGUI.EndChangeCheck()) { for (int i = 0; i < Selection.gameObjects.Length; ++i) { if (Selection.gameObjects[i] == null) { continue; } IsoTile _t = Selection.gameObjects[i].GetComponent <IsoTile>(); if (_t != null && !_t.IsUnionCube()) { _t.Toggle_Side(_bToggle, _sideType); } } } List <Iso2DObject> _lookupList = Iso2DObject.GetSideListOfTileSelection(_sideType); if (_bToggle && _lookupList.Count > 0) { if (_obj == null) { _obj = _tile_Scene.GetSideObject(_sideType); } _Rect.y += _Rect.height; CustomEditorGUI.Undo_Iso2DSpriteField(_Rect, _obj.sprr.sprite, _lookupList, _color); } return(_obj); }