-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added obsolete markers to old attributes
- Migrated old attributes to Legacy
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Linq; | ||
using UdonSharp; | ||
using UnityEngine; | ||
using VRC.Udon.Editor.ProgramSources; | ||
|
||
namespace UdonToolkit.Legacy { | ||
[Obsolete("This attribute is not needed anymore as it is only used with now deprecated Controllers. Learn more: https://l.vrchat.sh/utV4Migrate")] | ||
[AttributeUsage(AttributeTargets.Class)] | ||
public class ControlledBehaviourAttribute : Attribute { | ||
public UdonProgramAsset uB; | ||
|
||
public ControlledBehaviourAttribute(Type T) { | ||
var assets = Resources.FindObjectsOfTypeAll(typeof(UdonSharpProgramAsset)) | ||
.Select(a => a as UdonSharpProgramAsset).ToArray(); | ||
foreach (var asset in assets) { | ||
try { | ||
if (asset != null && asset.sourceCsScript.GetClass() == T) { | ||
uB = asset; | ||
} | ||
} | ||
catch { | ||
// ignored | ||
} | ||
} | ||
} | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.