besample
Unity Profiler Begin/End Sample Block
Scope C# 2.0+ statements, Unity C# file
Body
UnityEngine.Profiling.Profiler.BeginSample("$VAR$");
$SELECTION$$END$
UnityEngine.Profiling.Profiler.EndSample();
Parameters
VAR - Shows basic code completion list at the point where the variable is evaluated
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
foreach
foreach block
Scope C# 2.0+ statements
Body
foreach ($TYPE$ $VARIABLE$ in $COLLECTION$)
{
$SELECTION$$END$
}
Parameters
COLLECTION - Shows basic code completion list at the point where the variable is evaluated
TYPE - Suggests a type for a new variable declared in the template
VARIABLE - When executed in a variable declaration (where variable name should stand), suggests a name for the variable
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
for
Simple "for" loop
Scope C# 2.0+ statements
Body
for (int $INDEX$ = 0; $INDEX$ < $UPPER$; $INDEX$++)
{
$SELECTION$$END$
}
Parameters
INDEX - Suggests a unique name for an index variable at the evaluation point
UPPER - no macro
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
Before expansion
After expansion
#if
Scope C# 2.0+ except strings, At line start
Body
#if $expression$
$SELECTION$$END$
#endif
Parameters
expression - Evaluates to the specified constant value
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
#region
Surround the selection with a region
Scope C# 2.0+ except strings, At line start
Body
#region $name$
$SELECTION$$END$
#endregion
Parameters
name - Evaluates to the specified constant value
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
Before expansion
After expansion
namespace
Add a namespace to the selected code
Scope C# 2.0+ types and namespaces
Body
namespace $name$
{
$END$$SELECTION$
}
Parameters
name - Evaluates to the specified constant value
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
Before expansion
After expansion
tryf
try finally
Scope C# 2.0+ statements
Body
try
{
$SELECTION$
}
finally
{
$END$
}
Parameters
try
try catch
Scope C# 2.0+ statements
Body
try
{
$SELECTION$
}
catch ($EXCEPTION$ $EX_NAME$)
{
$SELSTART$System.Console.WriteLine($EX_NAME$);
throw;$SELEND$
}
Parameters
EXCEPTION - Evaluates to the specified constant value
EX_NAME - When executed in a variable declaration (where variable name should stand), suggests a name for the variable
SELECTION - The text selected by the user before invoking the template.
while
while loop
Scope C# 2.0+ statements
Body
while ($expression$)
{
$SELECTION$$END$
}
Parameters
expression - Shows basic code completion list at the point where the variable is evaluated
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
Before expansion
After expansion
do
do...while loop
Scope C# 2.0+ statements
Body
do
{
$SELECTION$$END$
} while ($expression$);
Parameters
expression - Shows basic code completion list at the point where the variable is evaluated
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
if
if statement
Scope C# 2.0+ statements
Body
if ($expr$)
{
$SELECTION$$END$
}
Parameters
expr - Shows basic code completion list at the point where the variable is evaluated
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
Before expansion
After expansion
lock
lock statement
Scope C# 2.0+ statements
Body
lock ($expression$)
{
$SELECTION$$END$
}
Parameters
expression - Shows basic code completion list at the point where the variable is evaluated
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
Before expansion
After expansion
using
using statement
Scope C# 2.0+ statements
Body
using($resource$)
{
$SELECTION$$END$
}
Parameters
resource - Shows basic code completion list at the point where the variable is evaluated
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
Before expansion
After expansion
cast
Cast the selection to a specific type
Scope C# 2.0+ expressions
Body
(($TYPE$)$SELECTION$)
Parameters
Before expansion
After expansion