I added a script onto a duplicate of the Standard Dialogue UI prefab. I added the script onto the PC Subtitle Panel continue button and was having that button's OnClick called a custom function.
This resulted in all of my PixelCrushers namespace references breaking. Also visual studio is no longer auto-filling any methods from MonoBehaviour like Start(), OnDisable() etc. Other intellisense stuff is working fine such as gameObject or transform properties.
I got this console message:
Overriding existing asset with new GUID from package, this may break links within your project to package assets (Assets/Plugins/Pixel Crushers/Dialogue System/Prefabs/Dialogue Manager.prefab)
Thanks in advance for any help!
Overriding existing asset with new GUID from package. Breaking links within project.
-
- Posts: 5
- Joined: Mon Feb 21, 2022 3:28 am
-
- Posts: 5
- Joined: Mon Feb 21, 2022 3:28 am
Re: Overriding existing asset with new GUID from package. Breaking links within project.
Following up from this, I have gone back to my last stable version of the game. Perhaps you could help me to instead work out a better way of calling my own custom function when the Standard Dialogue UI's NPC subtitle continue button is pressed. Because it's a prefab instantiated at runtime I can't drag scripts into the OnClick method in the editor. I was hoping to be able to subscribe to an event but have been struggling to find one.
Re: Overriding existing asset with new GUID from package. Breaking links within project.
Hi,
The Visual Studio issue is probably coincidental and unrelated. Try updating your Visual Studio for Unity package in Unity's Package Manager window. Then select Edit > Preferences. In the External Tools section, click Regenerate Project Files.
For the continue button issue, inspect your prefab. If you're basing this on any of the starter prefab UIs provided in the Dialogue System package, I recommend making and using a duplicate copy. That way you won't lose your customizations when you update the Dialogue System.
When you inspect the prefab, the Inspector view should show an option to Open Prefab. If you click this, you can edit the prefab, including the continue button.
If the issue is that you want to assign OnClick() to something outside of the prefab, that's possible, too. However, you should only assign something that's still within the Dialogue Manager GameObject's hierarchy. Otherwise the assignment will get lost when you change scenes.
To assign OnClick() to something outside of the prefab, exit prefab edit mode. Inspect the Dialogue Manager GameObject. Unassign the Dialogue UI field. Then drag your prefab into the Dialogue UI field. It will ask if you want to Add Instance or Use Prefab. Click Add Instance. This will add an instance inside the Dialogue Manager's Canvas. You should then be able to assign things in the Dialogue Manager's hierarchy to the continue button's OnClick().
The Visual Studio issue is probably coincidental and unrelated. Try updating your Visual Studio for Unity package in Unity's Package Manager window. Then select Edit > Preferences. In the External Tools section, click Regenerate Project Files.
For the continue button issue, inspect your prefab. If you're basing this on any of the starter prefab UIs provided in the Dialogue System package, I recommend making and using a duplicate copy. That way you won't lose your customizations when you update the Dialogue System.
When you inspect the prefab, the Inspector view should show an option to Open Prefab. If you click this, you can edit the prefab, including the continue button.
If the issue is that you want to assign OnClick() to something outside of the prefab, that's possible, too. However, you should only assign something that's still within the Dialogue Manager GameObject's hierarchy. Otherwise the assignment will get lost when you change scenes.
To assign OnClick() to something outside of the prefab, exit prefab edit mode. Inspect the Dialogue Manager GameObject. Unassign the Dialogue UI field. Then drag your prefab into the Dialogue UI field. It will ask if you want to Add Instance or Use Prefab. Click Add Instance. This will add an instance inside the Dialogue Manager's Canvas. You should then be able to assign things in the Dialogue Manager's hierarchy to the continue button's OnClick().