Skip to content
This repository was archived by the owner on Dec 6, 2021. It is now read-only.

Commit 614b4e7

Browse files
authored
Merge pull request #5 from umm/support_upm
Support UPM
2 parents 41b50cb + d58d9c0 commit 614b4e7

11 files changed

+138
-47
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Publish UPM Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: monry/actions-upm-publish@v1
15+
with:
16+
npm_auth_token: ${{ secrets.NPM_AUTH_TOKEN }}

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://upm-packages.dev

Assets/CHANGELOG.md

Whitespace-only changes.

Assets/CHANGELOG.md.meta

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/README.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# stopwatch
2+
3+
## What
4+
5+
- StopWatch logic based on unity frame updates
6+
7+
## Requirement
8+
9+
- unirx
10+
- extra\_unirx
11+
12+
## Install
13+
14+
### With Unity Package Manager
15+
16+
```bash
17+
upm add package dev.upm-packages.stopwatch
18+
```
19+
20+
Note: `upm` command is provided by [this repository](https://github.com/upm-packages/upm-cli).
21+
22+
You can also edit `Packages/manifest.json` directly.
23+
24+
```jsonc
25+
{
26+
"dependencies": {
27+
// (snip)
28+
"dev.upm-packages.stopwatch": "[latest version]",
29+
// (snip)
30+
},
31+
"scopedRegistries": [
32+
{
33+
"name": "Unofficial Unity Package Manager Registry",
34+
"url": "https://upm-packages.dev",
35+
"scopes": [
36+
"dev.upm-packages"
37+
]
38+
}
39+
]
40+
}
41+
```
42+
43+
### Any other else (classical umm style)
44+
45+
```shell
46+
yarn add "umm/stopwatch#^1.0.0"
47+
```
48+
49+
## Usage
50+
51+
```csharp
52+
var stopwatch = new StopWatch();
53+
stopwatch.TimeAsObservable.Subscribe(it => UnityEngine.Debug.LogFormat("time: {0}", it);
54+
55+
stopwatch.Start();
56+
stopwatch.Pause();
57+
stopwatch.Resume();
58+
stopwatch.Stop();
59+
```
60+
61+
It's easy to inject clocking.
62+
63+
```
64+
var oscillator = new Subject<float>();
65+
var stopwatch = new StopWatch(oscillator);
66+
67+
oscillator.OnNext(1f); // 1f second passed
68+
```
69+
70+
## License
71+
72+
Copyright (c) 2018 Takuma Maruyama
73+
74+
Released under the MIT license, see [LICENSE.txt](LICENSE.txt)

Assets/README.md.meta

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/package.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "dev.upm-packages.stopwatch",
3+
"displayName": "StopWatch",
4+
"version": "1.2.0",
5+
"unity": "2019.3",
6+
"description": "StopWatch is time utility based on Unity frame updates",
7+
"homepage": "https://github.com/umm/stopwatch",
8+
"bugs": {
9+
"url": "https://github.com/umm/stopwatch/issues"
10+
},
11+
"author": "Takuma Maruyama",
12+
"license": "MIT",
13+
"keywords": [],
14+
"category": "",
15+
"dependencies": {
16+
"dev.upm-packages.extra-unirx": "1.4.1"
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git@github.com:umm/stopwatch"
21+
}
22+
}

Assets/package.json.meta

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Assets/CHANGELOG.md

README.md

-44
This file was deleted.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Assets/README.md

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@umm/stopwatch",
3-
"version": "1.1.2",
3+
"version": "1.2.0",
44
"description": "StopWatch is time utility based on Unity frame updates",
55
"homepage": "https://github.com/umm/stopwatch",
66
"bugs": {
@@ -25,8 +25,7 @@
2525
],
2626
"dependencies": {
2727
"@umm/extra_unirx": "umm/extra_unirx#^1.0.0",
28-
"@umm/scripts": "umm/scripts#^1.0.0",
29-
"@umm/unirx": "umm/unirx#^2.0.0"
28+
"@umm/scripts": "umm/scripts#^1.0.0"
3029
},
3130
"devDependencies": {}
3231
}

0 commit comments

Comments
 (0)