Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Thundernerd/Unity3D-ScriptingDefineUtility

a small helper that allows you to more easily modify the scripting define symbols for your project
https://github.com/Thundernerd/Unity3D-ScriptingDefineUtility

Last synced: 3 months ago
JSON representation

a small helper that allows you to more easily modify the scripting define symbols for your project

Awesome Lists containing this project

README

        

# Scripting Define Utility


GitHub package.json version

GitHub issues


GitHub pull requests


GitHub license

GitHub last commit

Scripting Define Utility is a small helper that allows you to more easily modify the scripting define symbols for your project.

## Installation
1. The package is available on the [openupm registry](https://openupm.com). You can install it via [openupm-cli](https://github.com/openupm/openupm-cli).
```
openupm add net.tnrd.scriptingdefineutility
```
2. Installing through a [Unity Package](http://package-installer.glitch.me/v1/installer/package.openupm.com/net.tnrd.scriptingdefineutility?registry=https://package.openupm.com) created by the [Package Installer Creator](https://package-installer.glitch.me) from [Needle](https://needle.tools)

[](http://package-installer.glitch.me/v1/installer/package.openupm.com/net.tnrd.scriptingdefineutility?registry=https://package.openupm.com)

## Usage
There's a couple of interactions you can do with the ScriptingDefineUtility

#### Adding
Adding a new define symbol to the list

```csharp
private void Foo()
{
ScriptingDefineUtility.Add("Bar");
}
```

#### Removing
Removing an existing define symbol from the list

```csharp
private void Foo()
{
ScriptingDefineUtility.Remove("Bar");
}
```

#### Contains
Checking if a symbol is in the current symbols list

```csharp
private void Foo()
{
if (ScriptingDefineUtility.Contains("Bar"))
{
...
}
}
```

#### Getting
There are two ways of getting all the define symbols

This returns all the symbols as stored in the settings.
```csharp
private void Foo()
{
string symbols = ScriptingDefineUtility.GetSymbols();
}
```

This returns all the symbols split by the delimiter ; (semicolon) and returns it as a string array
```csharp
private void Foo()
{
string[] symbols = ScriptingDefineUtility.Symbols;
}
```

## Support
**Scripting Define Utility** is a small and open-source utility that I hope helps other people. It is by no means necessary but if you feel generous you can support me by donating.

[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/J3J11GEYY)

## Contributing
Pull requests are welcomed. Please feel free to fix any issues you find, or add new features.