public static int ToInt(this string str, int defV = 0) { try { defV = Convert.ToInt32(str); } catch (System.Exception e) { LitLogger.Error(e.Message); } return(defV); }
public static float ToFloat(this string str, float defV = 0) { try { defV = Convert.ToSingle(str); } catch (System.Exception e) { LitLogger.Error(e.Message); } return(defV); }
public void AddChild(SerializeObj so) { if (so == null) { LitLogger.Error("Con'not add null child"); return; } if (childs == null) { childs = new List <SerializeObj>(); } childs.Add(so); }
public override void OnInspectorGUI() { litSerObj.Update(); base.OnInspectorGUI(); GUILayout.Space(20); if (GUILayout.Button("Generate LitObjs")) { if (target is LitGenerator) { var genterator = target as LitGenerator; genterator.Generate(); } else { LitLogger.Error("Generate Error"); } } litSerObj.Apply(); }