this is a test hello i hope this works!!
UPM: How to make a custom package
So, Unity has this shiny new package manager, and you have code you want to share between projects - wouldn't it be great if we could bundle up our shared code and plug it into all the projects that need it? Let's figure out how
to make our own Package!
Todo
- Modify the project manifest
- Make a package manifest
- Package the manifest up with some test code
- Try it out in Unity!
Project Manifest
Unity uses a
'Manifest' file to tell it what packages a project cares about. It's essentially a list of the packages we want and what versions we care about. we can also flag up packages we don't want included.
Let's open up our manifest and in a custom dependency on a local [package].
Note: where to find the manifest
- Depending on what beta version of Unity 2018.1 you are using,
manifest.json
might be in a diffent folder as its location changed in b9
- Unity 2018.1b9 >: ProjectRoot/Packages
- Unity 2018.1b1-b8: ProjectRoot/UnityPackageManager
this is a test hello i hope this works!!
UPM: How to make a custom package
So, Unity has this shiny new package manager, and you have code you want to share between projects - wouldn't it be great if we could bundle up our shared code and plug it into all the projects that need it? Let's figure out how
to make our own Package!
Todo
- Modify the project manifest
- Make a package manifest
- Package the manifest up with some test code
- Try it out in Unity!
Project Manifest
Unity uses a
'Manifest' file to tell it what packages a project cares about. It's essentially a list of the packages we want and what versions we care about. we can also flag up packages we don't want included.
Let's open up our manifest and in a custom dependency on a local [package].
Note: where to find the manifest
- Depending on what beta version of Unity 2018.1 you are using,
manifest.json
might be in a diffent folder as its location changed in b9
- Unity 2018.1b9 >: ProjectRoot/Packages
- Unity 2018.1b1-b8: ProjectRoot/UnityPackageManager
Donation links via JSON referenced in the site config
-
<% site.donationLinks.forEach((page) => { %>
- <%= page.name %> - <%= page.url %> <% }) %>
Example
CustomSampler sampler;
IEnumerator Start()
{
// lets wait for half a second before we set off the system -- just to avoid any stutters
yield return new WaitForSeconds(0.5f);
// create a sampler so we can mesure performance
sampler = CustomSampler.Create("SimplePhysics");
// lets define an rough approximation for gravity
gravity = new Vector3(0, -9f, 0);
// and set up all our NativeArrays with initial values
velocities = new NativeArray<Vector3>(objectCount, Allocator.Persistent);
positions = new NativeArray<Vector3>(objectCount, Allocator.Persistent);
sleepingTimer = new NativeArray<int>(objectCount, Allocator.Persistent);
renderMatrices = new NativeArray<Matrix4x4>(objectCount, Allocator.Persistent);
renderMatrixArray = new Matrix4x4[objectCount];
asleep = new NativeQueue<int>(Allocator.Persistent);
for (int i = 0; i < objectCount; i++)
{
Respawn(i);
}
}
private void Respawn(int i)
{
// Random cannot be used from jobs so this always has to execute on the main thread.
//velocities[i] = Random.onUnitSphere * Random.Range(2, 10); // spawn objects with velocities spreading them out in a sphere
velocities[i] = (Random.onUnitSphere + (((spawnDirection.position - transform.position).normalized).normalized)*1.3f).normalized * Random.Range(2f, 10f); // spawn with velocities arching towards a target object
positions[i] = transform.position;
sleepingTimer[i] = 0;
renderMatrices[i] = Matrix4x4.identity;
}
Try EJS online at: https://ionicabizau.github.io/ejs-playground/.
*We DID IT *
okay over