/// <summary> /// Register on server events /// </summary> private void RegisterOnServerEvents() { hub.On <byte[], string>("SetActionScriptAssemblyData", (assembly, typeName) => { ActionScriptManager.SetActionScriptAssemblyData(assembly, typeName); if (ClientManager.ActionScriptSettings.RunImmediately) { log.Info("Requesting server preconfigured actions..."); ///Request action script commands this.CallServerMethod("RequestActionScriptCommands"); } }); hub.On <string, object[]> ("invokeAction", (method, parameters) => { ActionScriptResult result = ActionScriptManager.InvokeAction(method, parameters); ///Informs the server about the result this.CallServerMethod("SetActionResultResponse", result); }); }
public void SetupGame(GameMaster gm) { gameMaster = gm; actionScriptManager = GameObject.FindGameObjectWithTag("ActionScriptManager").GetComponent <ActionScriptManager>(); }