MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnSet

Method OnSet

Source/Engine/Content/Asset.cpp:85–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void AssetReferenceBase::OnSet(Asset* asset)
86{
87 auto e = _asset;
88 if (e != asset)
89 {
90 if (e)
91 e->RemoveReference(this);
92 _asset = e = asset;
93 if (e)
94 e->AddReference(this);
95 Changed();
96 if (_owner)
97 _owner->OnAssetChanged(asset, this);
98 if (e && e->IsLoaded())
99 {
100 Loaded();
101 if (_owner)
102 _owner->OnAssetLoaded(asset, this);
103 }
104 }
105}
106
107WeakAssetReferenceBase::~WeakAssetReferenceBase()
108{

Callers 6

SoftAssetReferenceMethod · 0.45
SoftAssetReferenceClass · 0.45
AssetReferenceMethod · 0.45
AssetReferenceClass · 0.45
WeakAssetReferenceMethod · 0.45
WeakAssetReferenceClass · 0.45

Calls 6

GetIDMethod · 0.80
RemoveReferenceMethod · 0.45
AddReferenceMethod · 0.45
OnAssetChangedMethod · 0.45
IsLoadedMethod · 0.45
OnAssetLoadedMethod · 0.45

Tested by

no test coverage detected