public override void OnInspectorGUI() { TechnologyCard technologyCard = (TechnologyCard)target; DrawDefaultInspector(); if (technologyCard.techType == TechnologyCard.TechType.Commodity || technologyCard.techType == TechnologyCard.TechType.CommodityModifier) { if (technologyCard.techType == TechnologyCard.TechType.CommodityModifier) { technologyCard.efficencymod = EditorGUILayout.IntField("Modifier:", technologyCard.efficencymod); } EditorGUILayout.BeginHorizontal(); GUIStyle style = new GUIStyle(EditorStyles.foldout); //style.fixedWidth = 25; commodityFoldout = EditorGUILayout.Foldout(commodityFoldout, "Commodity", style); technologyCard.commodity = (CommodityData)EditorGUILayout.ObjectField("", technologyCard.commodity, typeof(CommodityData), allowSceneObjects: false); EditorGUILayout.EndHorizontal(); if (technologyCard.commodity != null) { if (commodityFoldout) { commodityEditor = Editor.CreateEditor(technologyCard.commodity); commodityEditor.OnInspectorGUI(); } } } }
public Technology(TechnologyCard _techCard) { techCard = _techCard; techName = _techCard.techName; descrption = _techCard.descrption; researchCost = _techCard.researchCost; canResearch = false; researched = false; isResearching = false; isSetAsCard = false; isStartingTech = _techCard.startingTechnology; techCommodity = _techCard.commodity; techtype = _techCard.techType; }