Workflow from Aseprite and Photoshop to Unity for Sprite Art

October 7, 2020

Aseprite & Photoshop

Unity Workflow


Title: Improve your WORKFLOW using Aseprite/PS with UNITY
By: Dev!Bird
Youtube – Tutorial
Description: Tutorial showing workflow of creating sprites in Aesprite and Photoshop and importing them to Unity.


Overview

I initially looked into this because Aesprite is a software I have been interested in but haven’t looked to far into it yet. Seeing how easy it is to work with and import your work into Unity here definitely makes me interested in looking to get it if I want to do some more focused sprite work again in the future. Aesprite’s focus on sprite work making it rather simple to use but effective for both still images as well as animation make it a very appealing tool if you do not need the sophistication of Photoshop.

Unit Testing in Unity

August 25, 2019

Unit Testing

How to Use It

Youtube – Unit Testing in Unity – Livestream

By: Unity3d College

Unit testing is used to check that small chunks of your code can pass designed tests. These tests can be made in a way to show why a certain method or snippet of code is designed the way it is, and help inform other programmers on the project of why that is and also if they break some intended uses of the designed code. They just generally ensure that your code is doing what you expect it to, and remains doing what you expect.

The tests generally follow a “triple A” format: Arrange, Act, Assert.

  • Arrange: Set up the conditions for the test
  • Act: Perform actions that you want to test
  • Assert: This is the check used to test

In this lecture, they have setup a very nice system for holding all of their testing needs in Unity. Their is a specific Testing namespace with all the testing classes that hold public test methods. These are accessible through a specific window in Unity and can be run in the Editor, as opposed to constantly needing to run the tests in the play mode of Unity. This uses a setup with assembly definitions and other editor interactions I am unfamiliar with, so I will need to look into that more to setup a system like this.

The test system they have setup does not work particularly well with MonoBehaviours. This is because a lot of tests involve creating new objects to arrange the test, and Unity does not allow MonoBehaviours to be created with the new keyword. You must create a separate gameobject and attached the MonoBehaviours with an addComponent type approach.

This can be worked around with something called NSubstitute. You can grab this online, it is a .dll file that you place in your Pluging > Editor folder to help use with all your testing. It allows for use of the NSubstitute namespace to use this Substitue.For method which somehow works around the MonoBehaviours issues for testing purposes. This can also be used to test interfaces, which also cannot just be made as new objects.

Later they do some play mode tests, which test that adding force to a rigidbody is moving the body properly. This type of testing could actually lead to something very useful with my thesis research as I may want to be monitoring the movement of physical bodies to see if they are behaving properly.

Others to Checkout for Unity Programming Content

There were a few final notes on some people to find on Youtube for more on programming in general and with Unity:

  • UncleBob Bob Martin (Design Patterns, C# focused, not Unity specific)
  • Mob Mentality Show – Good for groups of programmers

Modeling in Maya and Exporting to Unity – Scaling

Feb. 15th, 2018

Import/Export Between Maya and Unity – Scaling

Maya to Unity Scale Guide

The scaling between Maya and Unity can act a bit strangely. It appears to be because Unity treats its units as “meters” by default, and Maya treats its units in “centimeters” by default. This guide helps in figuring out how to set up your Maya work file and its export, along with the Unity import, so that the scaling of objects makes sense.

Directly from the guide: “The best reason I can figure from all the posts on the web is that Maya’s native units are centimeters and that is how it “thinks” about its scenes. Anything exporting FROM Maya will essentially be in centimeters, so even though we set the scale of our objects to Meters, they are actually still in centimeters. The FBX, however, doesn’t really care about scale. It will, however, pull the relative scale value out based on what you are trying to export it as. In this case, we have a centimeter based file and we want it to actually be in Meters, so we need to multiply everything by 100 in order to get it sized properly.”

Maya Models

Process for creating models in Maya and exporting properly into Unity:

  1. Maya: Windows -> Settings/Preferences -> Preferences
  2. Settings: Change “Working Units” – “Linear” to “meter”
  3. Creates model to a believable size, assuming 1 unit in maya is equivalent to 1 meter
  4. Save this current Maya Scene as a Maya ASCII file that will serve as the base file that can be edited later if necessary to change certain parameters
  5. Once that is done, “Save As” another scene. This will be used for exporting the current setup of the scene
  6. In this second version of the scene, it is good practice before exporting to:
    • Modify -> Freeze Transforms
    • Edit -> Delete All By Type -> History
    • This removes some background clutter from the file before exporting, but they can be useful for later editing/revisions, which is why we save a separate version to access later.
  7. File -> Export All[square] -> File Type: FBX Export, make sure to Edit Preset
  8. Units -> “File units converted to:” centimeters (may also be useful to check FBX File Format and change that type to “ASCII”
  9. Can also edit some other values in this preset: Objects such as Lights and Cameras can most likely be removed from the export process (again, reducing file clutter)
  10. Export All
  11. In Unity, should simply be able to drag and drop your .fbx file into the assets
  12. The “File Scale” of the object will show 0.01, but the transform scale value in Unity should be (1,1,1)
  13. Object should be correct size in Unity!