{"id":23066407,"url":"https://github.com/xjine/unity_remotecommands","last_synced_at":"2025-08-15T11:32:58.774Z","repository":{"id":83607012,"uuid":"175007028","full_name":"XJINE/Unity_RemoteCommands","owner":"XJINE","description":"RemoteCommand provides a simple logic to execute your methods from remote.","archived":false,"fork":false,"pushed_at":"2024-11-12T02:26:18.000Z","size":88,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-12T03:23:31.971Z","etag":null,"topics":["assets","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XJINE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-11T13:34:09.000Z","updated_at":"2024-11-12T02:21:16.000Z","dependencies_parsed_at":"2024-01-09T05:41:14.596Z","dependency_job_id":"7c909bcc-aa88-4b31-bd97-cdf88372e116","html_url":"https://github.com/XJINE/Unity_RemoteCommands","commit_stats":null,"previous_names":["xjine/unity_remotecommands"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XJINE%2FUnity_RemoteCommands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XJINE%2FUnity_RemoteCommands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XJINE%2FUnity_RemoteCommands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XJINE%2FUnity_RemoteCommands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XJINE","download_url":"https://codeload.github.com/XJINE/Unity_RemoteCommands/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229910988,"owners_count":18143229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assets","unity"],"created_at":"2024-12-16T05:13:04.899Z","updated_at":"2024-12-16T05:13:05.502Z","avatar_url":"https://github.com/XJINE.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity_RemoteCommands\n\n``RemoteCommands`` provides a simple logic to execute your methods from remote.\n\n## Importing\n\nYou can use Package Manager or import it directly.\n\n```\nhttps://github.com/XJINE/Unity_RemoteCommands.git?path=Assets/Packages/RemoteCommands\n```\n\n### Dependencies\n\nThis project use following resources.\n\n- [Unity_SingletonMonoBehaviour](https://github.com/XJINE/Unity_SingletonMonoBehaviour)\n- [Unity_IInitializable](https://github.com/XJINE/Unity_IInitializable)\n\n## How to Use\n\nSet ``RemoteCommand`` attribute and the unique id.\nThen, call ``RemoteCommander.Command()`` with id. That's all.\n\n\n```csharp\n[RemoteCommand(ID = \"SampleCommandA\")]\npublic void SampleCommandA()\n{\n    Debug.Log(\"SampleCommandA\");\n}\n\nRemoteCommander.Instance.Command(\"SampleCommandA\");\n```\n\nFunction name will be set as ID when omitting it.\n\n```csharp\n[RemoteCommand]\npublic void SampleCommandB()\n{\n    Debug.Log(\"SampleCommand\");\n}\n```\n\n### Various Types\n\n``RemoteCommand`` attribute is valid for ``public``, ``private``, ``protected`` and ``static`` methods.\n\n```csharp\n[RemoteCommand]\nprivate void SampleCommandPrivate(){}\n\n[RemoteCommand]\npublic static void SampleCommandStatic(){}\n```\n\n### Args and Return Value\n\n``Command`` method can be set some args and we can get the return value from it.\n\n```csharp\n[RemoteCommand]\npublic float SampleCommandArgsReturn(int ivalue, float fvalue)\n{\n    Debug.Log(\"SampleCommandReturn \" + ivalue + \", \" + fvalue);\n    return ivalue + fvalue;\n}\n\nobject sum = RemoteCommander.Instance.Command(\"SampleCommandArgsReturn\", 999, 3.14f);\n```\n\n## Limitation\n\n``RemoteCommand`` must be declared in ``MonoBehaviour`` (or that inheritance).\nAnd the instances are must be in the scene before it starts.\n\n``RemoteCommand.ID`` is must be unique in your scene.\n\n### Override\n\n```csharp\npublic class SampleA : MonoBehaviour\n{\n    [RemoteCommand(ID = \"SampleCommandVirtual\")]\n    public virtual void SampleCommandOverride()\n    {\n        Debug.Log(\"SampleA.SampleCommandOverride\");\n    }\n}\npublic class SampleB : SampleA\n{\n    [RemoteCommand(ID = \"SampleCommandOverride\")]\n    public override void SampleCommandOverride()\n    {\n        Debug.Log(\"SampleB.SampleCommandOverride\");\n    }\n}\n…\nRemoteCommander.Instance.Command(\"SampleCommandVirtual\");\nRemoteCommander.Instance.Command(\"SampleCommandOverride\");\n```\n\nWhen the ``Command(\"SampleCommandVirtual\")`` and ``Command(\"SampleCommandOverride\")`` are invoked with ``SampleB`` instance, it shows the same result.\nThe results are ``\"SampleB.SampleCommandOverride\"``.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxjine%2Funity_remotecommands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxjine%2Funity_remotecommands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxjine%2Funity_remotecommands/lists"}