Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Add check for if an UdonBehaviour is using the correct program asset
Browse files Browse the repository at this point in the history
- This is also done by Udon, but some people have had weird issues that look like the program asset not updating so we'll add handling here too
  • Loading branch information
MerlinVR committed Mar 25, 2021
1 parent ab14976 commit f2de786
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Assets/UdonSharp/Editor/UdonSharpEditorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,11 @@ static void UpdateSerializedProgramAssets(List<UdonBehaviour> udonBehaviours)
UdonSharpProgramAsset programAsset = behaviour.programSource as UdonSharpProgramAsset;
if (programAsset == null)
continue;

if (_serializedAssetField.GetValue(behaviour) == null)

AbstractSerializedUdonProgramAsset serializedProgramAsset = _serializedAssetField.GetValue(behaviour) as AbstractSerializedUdonProgramAsset;

if (serializedProgramAsset == null ||
serializedProgramAsset != programAsset.SerializedProgramAsset)
{
SerializedObject serializedBehaviour = new SerializedObject(behaviour);
SerializedProperty serializedProgramProperty = serializedBehaviour.FindProperty("serializedProgramAsset");
Expand Down

0 comments on commit f2de786

Please sign in to comment.