Skip to content

Commit 693e010

Browse files
committed
Add documentation, license
1 parent 05c9d21 commit 693e010

File tree

3 files changed

+102
-0
lines changed

3 files changed

+102
-0
lines changed

LICENSE

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
MIT License
2+
-----------
3+
4+
Copyright (c) 2021 Eliza Velasquez
5+
Permission is hereby granted, free of charge, to any person
6+
obtaining a copy of this software and associated documentation
7+
files (the "Software"), to deal in the Software without
8+
restriction, including without limitation the rights to use,
9+
copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the
11+
Software is furnished to do so, subject to the following
12+
conditions:
13+
14+
The above copyright notice and this permission notice shall be
15+
included in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24+
OTHER DEALINGS IN THE SOFTWARE.

README.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# unity.el
2+
3+
This package provides some Emacs integration with the Unity game engine. Most
4+
notably, it provides the ability to open source files from Unity in Emacs or
5+
Emacsclient while still generating the solution and project files for use with
6+
`lsp-mode`.
7+
8+
Additionally, this package can install hooks/advice for smoother interop with
9+
certain Unity quirks.
10+
11+
## Installation
12+
13+
Currently, this package is not on M?ELPA. In the meantime, please clone and
14+
extend your load path. For example:
15+
16+
```elisp
17+
(use-package 'unity
18+
:load-path "site-lisp/unity.el"
19+
:config
20+
(unity-build-code-shim)
21+
(unity-setup))
22+
```
23+
24+
## Configuration
25+
26+
`unity.el` exposes two functions, `unity-build-code-shim` and `unity-setup`.
27+
28+
### `unity-build-code-shim`
29+
30+
Unity does not generate project or solution files unless the external text
31+
editor is recognized as Visual Studio, Visual Studio Code, or MonoDevelop.
32+
Unfortunately, this means that other editors which wish to leverage the power of
33+
the OmniSharp language server are obtuse to use with Unity. `unity.el` provides
34+
a workaround for this issue: it compiles a very simple binary named
35+
`code`/`code.exe` which can be set as Unity's external editor to trick it into
36+
generating the solution/project files as normal.
37+
38+
The shim simply invokes the remaining command line arguments as a command line.
39+
For example, the following command runs `emacsclient Foo.cs`.
40+
41+
```sh
42+
code emacsclient Foo.cs
43+
```
44+
45+
`unity-build-code-shim` will compile the shim, placing the resulting
46+
`code`/`code.exe` file in `[emacs-user-directory]/var/unity/`.
47+
48+
You can then change the "External Script Editor" setting to point to `code` and
49+
adjust the "External Script Editor Args" arguments as such to run `emacsclient`
50+
(or any program of your choosing, for that matter).
51+
52+
```sh
53+
emacsclient -n +$(Line):$(Column) $(File)
54+
```
55+
56+
### `unity-setup`
57+
58+
This function installs any hooks, advice, etc. necessary for smoother
59+
Emacs/Unity interop. Currently this is limited to advising `rename-file` so that
60+
`.meta` files are automatically moved alongside their associated files.

unity.el

+18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
;;; unity.el --- Unity integration for Emacs -*- lexical-binding:t -*-
2+
3+
;; Version: 0.1.0
4+
;; Author: Eliza Velasquez
5+
;; Created: 30 May 2021
6+
;; Keywords: unity
7+
;; URL: https://github.com/elizagamedev/unity.el
8+
29
;;; Commentary:
10+
11+
;; This package provides some Emacs integration with the Unity game engine.
12+
;; Most notably, it provides the ability to open source files from Unity in
13+
;; Emacs or Emacsclient while still generating the solution and project files
14+
;; for use with `lsp-mode'.
15+
;;
16+
;; Additionally, this package can install hooks/advice for smoother interop with
17+
;; certain Unity quirks.
18+
;;
19+
;; See README.md for more information.
20+
321
;;; Code:
422

523
(defgroup unity nil

0 commit comments

Comments
 (0)