public override void OnInspectorGUI() { PathGame myTarget = (PathGame)target; EditorGUI.BeginChangeCheck(); GUILayout.Label("Name:"); string gName = EditorGUILayout.TextField(myTarget.name); GUILayout.Label("Author:"); string gAuthor = EditorGUILayout.TextField(myTarget.autor); GUILayout.Label("Description:"); string gDescription = EditorGUILayout.TextField(myTarget.description, GUILayout.Height(120)); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(myTarget, "Edit PathGame"); myTarget.gameName = gName; string assetPath = AssetDatabase.GetAssetPath(myTarget.GetInstanceID()); AssetDatabase.RenameAsset(assetPath, assetPath.Replace(assetPath, gName)); myTarget.autor = gAuthor; myTarget.description = gDescription; } if (GUILayout.Button("Edit")) { QuestWindow.Init(myTarget); } }
public void Init(PathGame game) { this.game = game; game.chains.Insert(0, this); dialogName = "New chain"; name = dialogName; }
public void Init(Chain chain) { this.game = chain.Game; this.chain = chain; state = chain.StartState; float z = 1; z = game.zoom; position = new Rect(0, 0, 208 * z, 30 * z); }
private void OnEnable() { link = (StateLink)target; game = AssetDatabase.LoadAssetAtPath <PathGame>(AssetDatabase.GetAssetPath(link)) as PathGame; if (link.chain == null) { link.chain = game.chains[0]; link.state = link.chain.StartState; } }
public void Init(Chain chain) { Guid = GuidManager.GetStateGuid(); this.chain = chain; game = chain.Game; description = ""; float z = 1; z = game.zoom; position = new Rect(300, 300, 208 * z, 30 * z); }