Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak(mono-rt2): change script initialization method #2854

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions code/client/clrcore-v2/BaseScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ internal void Initialize()
}
}

m_state = State.Initialized | State.Enabled;
m_state = State.Initialized;
Enable();
}

/// <summary>
Expand All @@ -129,7 +130,6 @@ public void Enable()
if (m_state == State.Uninitialized)
{
Initialize();
OnEnable();
}
else if ((m_state & State.Enabled) == 0)
{
Expand Down Expand Up @@ -234,7 +234,6 @@ public void RegisterTick(Func<Coroutine> tick, bool stopOnException = false)
{
CoroutineRepeat newTick = new CoroutineRepeat(tick, stopOnException);
m_tickList.Add(newTick);
newTick.Schedule();
}
}

Expand Down Expand Up @@ -309,7 +308,6 @@ internal void RegisterNuiCallback(string callbackName, DynFunc dynFunc)
throw new NotImplementedException();
#endif
m_nuiCallbacks.Add(callbackName, dynFunc);
Native.CoreNatives.RegisterNuiCallback(callbackName, dynFunc);
}

/// <summary>
Expand All @@ -328,7 +326,6 @@ public void RegisterNuiCallback(string callbackName, Delegate delegateFn)
#endif
DynFunc dynFunc = Func.Create(delegateFn);
m_nuiCallbacks.Add(callbackName, dynFunc);
Native.CoreNatives.RegisterNuiCallback(callbackName, dynFunc);
}

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion code/client/clrcore-v2/Interop/EventsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public EventHandlerSet(string eventName)
public EventHandlerSet Add(DynFunc deleg, Binding binding = Binding.Local)
{
m_handlers.Add(deleg);
EventsManager.AddEventHandler(m_eventName, deleg, binding);
return this;
}

Expand Down
Loading