Skip to content

Commit

Permalink
feat: Convert to UPM
Browse files Browse the repository at this point in the history
Reorganize project files
Separate out editor scripts into a different directory
  • Loading branch information
Vatsal Ambastha committed Apr 16, 2020
1 parent 22b0be8 commit e21dda0
Show file tree
Hide file tree
Showing 187 changed files with 2,706 additions and 1,103 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI
on:
push:
branches:
- master
jobs:
release:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Semantic Release
id: semantic
uses: cycjimmy/[email protected]
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create UPM branch
run: |
git branch -d upm &> /dev/null || echo upm branch not found
git subtree split -P "$PKG_ROOT" -b upm
git checkout upm
if [[ -d "Samples" ]]; then
git mv Samples Samples~
rm -f Samples.meta
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
git commit -am "fix: Samples => Samples~"
fi
git push -f -u origin upm
env:
PKG_ROOT: "Assets/Adrenak.Tork"

- name: Create UPM git tag
if: steps.semantic.outputs.new_release_published == 'true'
run: |
git tag $TAG upm
git push origin --tags
env:
TAG: upm/v${{ steps.semantic.outputs.new_release_version }}
20 changes: 20 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"tagFormat": "v${version}",
"plugins": [
["@semantic-release/commit-analyzer", { "preset": "angular" }],
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"preset": "angular",
"changelogFile":"Assets/Adrenak.Tork/CHANGELOG.MD"
}],
["@semantic-release/npm", {
"npmPublish": false,
"pkgRoot":"Assets/Adrenak.Tork"
}],
["@semantic-release/git", {
"assets": ["Assets/Adrenak.Tork/package.json", "Assets/Adrenak.Tork/CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
]
}
File renamed without changes.
Empty file.
7 changes: 7 additions & 0 deletions Assets/Adrenak.Tork/CHANGELOG.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Assets/Adrenak.meta → Assets/Adrenak.Tork/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions Assets/Adrenak.Tork/Editor/AckermannDebug.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using UnityEngine;

namespace Adrenak.Tork {
public class AckermannDebug : MonoBehaviour {
[SerializeField] Ackermann target;

void OnDrawGizmos() {
if (target.drawLevel == DrawLevel.Always)
Draw();
}

void OnDrawGizmosSelected() {
if (target.drawLevel == DrawLevel.OnSelected)
Draw();
}

void Draw() {
UnityEditor.Handles.color = Color.cyan;

if (target.FrontLeftWheel != null) {
var angle = target.FrontLeftWheel.transform.localEulerAngles.y;
var origin = target.FrontLeftWheel.transform.position;
UnityEditor.Handles.DrawLine(origin, origin + Quaternion.AngleAxis(angle, Vector3.up) * transform.forward);
}

if (target.FrontRightWheel != null) {
var angle = target.FrontRightWheel.transform.localEulerAngles.y;
var origin = target.FrontRightWheel.transform.position;
UnityEditor.Handles.DrawLine(origin, origin + Quaternion.AngleAxis(angle, Vector3.up) * transform.forward);
}
}
}
}
11 changes: 11 additions & 0 deletions Assets/Adrenak.Tork/Editor/AckermannDebug.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Assets/Adrenak.Tork/Editor/Adrenak.Tork.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Adrenak.Tork.Editor",
"references": [
"Adrenak.Tork.Runtime"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}
7 changes: 7 additions & 0 deletions Assets/Adrenak.Tork/Editor/Adrenak.Tork.Editor.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Assets/Adrenak.Tork/Editor/CenterOfMassAssignerDebug.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using UnityEngine;

namespace Adrenak.Tork{
public class CenterOfMassAssignerDebug : MonoBehaviour {
[SerializeField] CenterOfMassAssigner target;

private void OnDrawGizmos() {
Gizmos.color = Color.red;

if (target.m_Point != null)
Gizmos.DrawSphere(target.m_Point.position, .1f);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Adrenak.Tork/Editor/CenterOfMassAssignerDebug.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Assets/Adrenak.Tork/Editor/WheelDebug.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using UnityEngine;
using UnityEditor;

namespace Adrenak.Tork {
public class WheelDebug : MonoBehaviour {
[SerializeField] Wheel target;

void OnDrawGizmos() {
Handles.color = Color.yellow;
Handles.DrawWireDisc(transform.position, transform.right, target.radius);

Handles.color = Color.red;
var p1 = transform.position + transform.up * Wheel.k_RayStartHeight;
var p2 = transform.position - transform.up * (target.GetRayLen() - Wheel.k_RayStartHeight);
Handles.DrawLine(p1, p2);

var pos = transform.position + (-transform.up * (target.GetRayLen() - Wheel.k_RayStartHeight - target.CompressionDistance - target.radius));
Handles.DrawWireDisc(pos, transform.right, target.radius);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Adrenak.Tork/Editor/WheelDebug.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Assets/Adrenak.Tork/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Vatsal Ambastha

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions Assets/Adrenak.Tork/LICENSE.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions Assets/Adrenak.Tork/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Tork
A vehicle system for Unity

It is being developed for [Project Torque](https://forum.unity.com/threads/project-torque-offroad-racer-update-custom-wheel-colliders-and-physics.652135/#post-4379842). You can join its Discord server [here](https://discord.gg/bKp6VhX).

## Modules
- `Physics`
[Demo video](https://www.youtube.com/watch?v=gso45Zg_Z_Q)
Semi realistic/arcade vehicle physics. Features:
1. Ackermann steering
2. Motor and brake torque differential
3. Anti-roll bar
4. Mid-air steering
5. Mid-air stabilization

- `AI`
Currently has a simple `AIPlayer` script that approaches a destination
- `Effects`
Coming soon
- `Audio`
Coming soon

## Docs
Coming soon

## Forks
For a DOTS implementation check out [@PragneshRathod901's fork](https://github.com/PragneshRathod901/Tork)

## Contact
[@github](https://www.github.com/adrenak)
[@www](http://www.vatsalambastha.com)
7 changes: 7 additions & 0 deletions Assets/Adrenak.Tork/README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Loading

0 comments on commit e21dda0

Please sign in to comment.