Photon Fusion 2.1.1

FusionGlobalScriptableObjectSourceAttribute Class Referenceabstract

Base class for all attributes that can be used to load FusionGlobalScriptableObject. Attributes need to be registered at the assembly level. For instance, this snippet is used to register a default loader, that attempts to load from Resources based on FusionGlobalScriptableObjectAttribute.DefaultPath: More...

Public Member Functions

 FusionGlobalScriptableObjectSourceAttribute (Type objectType)
 
Parameters
objectTypeType or the base type of FusionGlobalScriptableObject that this loader supports.

FusionGlobalScriptableObjectLoadResult Load (Type type)
 Attempt to load the object of the specified type. Return default if the object cannot be loaded.
virtual System.Threading.Tasks.Task< FusionGlobalScriptableObjectLoadResultLoadAsync (Type type)

Properties

bool AllowEditMode = false [get, set]
 Can this loader be used in edit mode.
bool AllowFallback = false [get, set]
 Does this loader allow fallback to the next loader?
Type ObjectType [get]
 Type or the base type of FusionGlobalScriptableObject that this loader supports.
int Order [get, set]
 Order in which this loader will be executed. Lower values are executed first.

Detailed Description

Base class for all attributes that can be used to load FusionGlobalScriptableObject. Attributes need to be registered at the assembly level. For instance, this snippet is used to register a default loader, that attempts to load from Resources based on FusionGlobalScriptableObjectAttribute.DefaultPath:

[assembly: Fusion.FusionGlobalScriptableObjectResource(typeof(Fusion.FusionGlobalScriptableObject), Order = 2000, AllowFallback = true)]
A base class for ScriptableObjects that are meant to be globally accessible, at edit-time and runtime...
Definition FusionUnityTypes.Common.cs:20
int Order
Order in which this loader will be executed. Lower values are executed first.
Definition FusionUnityTypes.Common.cs:430
bool AllowFallback
Does this loader allow fallback to the next loader?
Definition FusionUnityTypes.Common.cs:438
Definition Allocator.cs:1
See also
FusionGlobalScriptableObjectAddressAttribute, FusionGlobalScriptableObjectResourceAttribute

Member Function Documentation

◆ Load()

FusionGlobalScriptableObjectLoadResult Load ( Type type)
abstract

Attempt to load the object of the specified type. Return default if the object cannot be loaded.

Parameters
typeThe requested type

◆ LoadAsync()

virtual System.Threading.Tasks.Task< FusionGlobalScriptableObjectLoadResult > LoadAsync ( Type type)
virtual
Parameters
type
Returns