Skip to content

Here are some useful snippets. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CO-createCoroutine.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<snippet>
<content><![CDATA[
IEnumerator ${1:name}(${2})
{
while (${3:true})
{
throw new NotImplementedException("Coroutine $1 is not implemented in " + this.ToString());
}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>co</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.cs</scope>
<description>
Create a coroutine.
</description>
</snippet>
12 changes: 12 additions & 0 deletions CO-startCoroutineNoWait.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<snippet>
<content><![CDATA[
StartCoroutine(${1:name}(${2}));
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>co</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.cs</scope>
<description>
Start a coroutine (no-wait).
</description>
</snippet>
12 changes: 12 additions & 0 deletions CO-startCoroutineWait.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<snippet>
<content><![CDATA[
yield return StartCoroutine(${1:name}(${2}));
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>co</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.cs</scope>
<description>
Start a coroutine (wait).
</description>
</snippet>
12 changes: 12 additions & 0 deletions CO-unity-wait.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<snippet>
<content><![CDATA[
yield return new WaitForSeconds(${1:int seconds});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>co</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.cs</scope>
<description>
Wait n seconds.
</description>
</snippet>
14 changes: 14 additions & 0 deletions EN-collisionEnter.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<snippet>
<content><![CDATA[
void OnCollisionEnter(Collision ${1:col})
{
throw new NotImplementedException("Collision hasn't been coded yet in " + this.ToString());

}

]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>en</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.cs</scope>
</snippet>