Fixed behaviour of script Awake() and Start() not getting called as intended (first frame that object is active) #370
|
@ -483,10 +483,19 @@ namespace SHADE
|
||||||
SAFE_NATIVE_CALL_BEGIN
|
SAFE_NATIVE_CALL_BEGIN
|
||||||
// Clear the awake queue
|
// Clear the awake queue
|
||||||
for each (Script ^ script in awakeList)
|
for each (Script ^ script in awakeList)
|
||||||
|
{
|
||||||
|
if (script->Owner.IsActiveInHierarchy)
|
||||||
{
|
{
|
||||||
script->Awake();
|
script->Awake();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inactiveAwakeList.Add(script);
|
||||||
|
}
|
||||||
|
}
|
||||||
awakeList.Clear();
|
awakeList.Clear();
|
||||||
|
awakeList.UnionWith(%inactiveAwakeList);
|
||||||
|
inactiveAwakeList.Clear();
|
||||||
|
|
||||||
// Clear the start queue
|
// Clear the start queue
|
||||||
for each (Script^ script in startList)
|
for each (Script^ script in startList)
|
||||||
|
@ -501,10 +510,7 @@ namespace SHADE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
startList.Clear();
|
startList.Clear();
|
||||||
for each (Script ^ script in startList)
|
startList.UnionWith(%inactiveStartList);
|
||||||
{
|
|
||||||
startList.Add(script);
|
|
||||||
}
|
|
||||||
inactiveStartList.Clear();
|
inactiveStartList.Clear();
|
||||||
|
|
||||||
SAFE_NATIVE_CALL_END_N("SHADE_Managed.ScriptStore")
|
SAFE_NATIVE_CALL_END_N("SHADE_Managed.ScriptStore")
|
||||||
|
|
|
@ -353,6 +353,7 @@ namespace SHADE
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
static ScriptDictionary scripts;
|
static ScriptDictionary scripts;
|
||||||
static ScriptSet awakeList;
|
static ScriptSet awakeList;
|
||||||
|
static ScriptSet inactiveAwakeList;
|
||||||
static ScriptSet startList;
|
static ScriptSet startList;
|
||||||
static ScriptSet inactiveStartList;
|
static ScriptSet inactiveStartList;
|
||||||
static ScriptSet disposalQueue;
|
static ScriptSet disposalQueue;
|
||||||
|
|
Loading…
Reference in New Issue