Skip to main content

πŸ’» Code

Development Assistant​

The development assistant is a general development assistant suited for providing knowledge on a wide variety of tasks.

Here are some of the topics the assistant can provide knowledge on:

  1. Unity Engine: provide guidance on using the Unity engine, including its various features and tools.
  2. Game Development: offer advice on game design principles, game mechanics, level design, and overall game development best practices.
  3. Scripting: assist you with scripting in C# within the Unity environment. This includes helping you understand and write code for gameplay mechanics, AI behaviors, UI interactions, and more.
  4. Performance Optimization: help you optimize your game's performance by providing tips and techniques to improve frame rate, reduce memory usage, and optimize resource management.
  5. Asset Integration: guide you on integrating various assets such as 3D models, animations, audio, and visual effects into your Unity project.
  6. Cross-platform Development: assist you in developing games for multiple platforms such as PC, mobile devices (iOS and Android), consoles, and VR/AR platforms.
  7. Version Control: help you set up and use version control systems like Git, enabling you to collaborate with other developers and manage your project's source code effectively.
  8. Debugging and Troubleshooting: provide guidance on debugging techniques, identifying and fixing common issues, and optimizing code for better performance.
  9. Third-Party Integration: assist you in integrating various third-party libraries, plugins, and APIs into your Unity project, such as analytics, social media, and in-app purchases.
  10. Project Management: offer advice on project organization, task management, and agile development methodologies to help you manage your game development process efficiently.

Tips for using the development assistant:

- Use succinct and precise language, do not use filler words.
- Define what Unity version you are using.
- Treat the AI as a developer with many years experience.
- The dev assistant remembers conversation context.
caution

The development assistant's dataset only goes up to September 2021. For this reason it is best to use Wingman in Unity 2021 projects and below, other projects are supported but Wingman may not yield correct responses for features found in later versions of Unity.

Script Editor​

Documentation coming soon.

Code Generator​

The code generator aims to generate code for Unity C# scripts. For example, prompting for the classic fibonacci sequence would look as follows:

Prompt:
"Write a Unity C# function to generate the first 9 numbers of the fibonnaci sequence, the
method should return the numbers in an array. Comment the code to explain what each piece
does and why it is written that way."


Response:
Sure! Here's a Unity C# function that generates the first 9 numbers of the Fibonacci sequence
and returns them in an array. I've added comments to explain each piece of code:


using UnityEngine;

public class FibonacciGenerator : MonoBehaviour
{
// Function to generate the first 9 numbers of the Fibonacci sequence
public int[] GenerateFibonacciNumbers()
{
int[] fibonacciNumbers = new int[9]; // Create an array to store the Fibonacci numbers

fibonacciNumbers[0] = 0; // Set the first Fibonacci number to 0
fibonacciNumbers[1] = 1; // Set the second Fibonacci number to 1

// Loop through the array starting from the third element
for (int i = 2; i < fibonacciNumbers.Length; i++)
{
// Calculate the Fibonacci number by adding the previous two numbers
fibonacciNumbers[i] = fibonacciNumbers[i - 1] + fibonacciNumbers[i - 2];
}

return fibonacciNumbers; // Return the array of Fibonacci numbers
}

// Example usage
private void Start()
{
int[] fibonacciNumbers = GenerateFibonacciNumbers(); // Generate the Fibonacci numbers

// Print the Fibonacci numbers
for (int i = 0; i < fibonacciNumbers.Length; i++)
{
Debug.Log("Fibonacci number at index " + i + ": " + fibonacciNumbers[i]);
}
}
}


Explanation:

1. We start by creating a class called `FibonacciGenerator` that inherits from `MonoBehaviour`.
This allows us to attach the script to a game object in Unity and use its functionality.
2. Inside the class, we define a public method called `GenerateFibonacciNumbers` that returns
an array of integers (`int[]`).
3. In the `GenerateFibonacciNumbers` method, we create an array called `fibonacciNumbers` with
a length of 9 to store the Fibonacci numbers.
4. We set the first two Fibonacci numbers (`fibonacciNumbers[0]` and `fibonacciNumbers[1]`) to
0 and 1, respectively.
5. We then use a `for` loop to calculate the remaining Fibonacci numbers. Starting from the
third element (`i = 2`), we calculate
each Fibonacci number by adding the previous two numbers (`fibonacciNumbers[i - 1]` and
`fibonacciNumbers[i - 2]`).
6. Finally, we return the `fibonacciNumbers` array.
7. In the `Start` method, we create an instance of the `FibonacciGenerator` class and call the
`GenerateFibonacciNumbers` method to generate the Fibonacci numbers.
8. We then use another `for` loop to print each Fibonacci number to the Unity console using `Debug.Log`.

As seen above the AI generates a great example output with code comments, a usage example and an explanation of the code generated.

Script Documentor​

Documentation coming soon.