Code Monkey home page Code Monkey logo

software-engineering-capstone's Introduction

Project Management

Codecks

Discord

Software Engineering Capstone

Software Installation and unity project setup

Coding Conventions

The coding convention for unity projects is to follow Microsoft's C# coding conventions. There are a few Unity specific tweaks to this. Private fields marked with the attribute [SerializeField] should have pascal case without the leading underscore.

Unity Serialization

Unity is a data driven engine. So when programming with unity it is important to understand the difference between Serialized and Non-Serialized.
The process of serialization is converting data between unity and C#. This is used to allow the creation instances of a class and modify the class's serialized values from the editor. This can be used to create controls to customize functionality or tweak values to modify behaviors. This can also be used to manually assign dependencies from the Unity Editor. Note: This can be useful at times, but it can cause to null reference errors if you forget to assign the dependency in the editor. For that reason I like to use this technique for assigning optional dependencies which alter functionality, and resolve all mandatory dependencies from code. The following types can be serialized by unity.

All serialized fields on Unity types will show up in the Inspector inside the Unity Editor.

Type Example Default Value
bool public bool canSprint = true; false
int public int maximumMana = 100; 0
float public float moveSpeed = 10; 0.0f
string public string spellID = "Water Bolt"; ""
enum types public Element startElement = Element.Water; First Declared Enum
Unity Types public GameObject playerPrefab; null
Array of any types above public string[] spells; new string[0]
List of any types above public List<GameObject> enemyPrefabs; new List<GameObject>()

a complete guide to Unity's serializable types can be found here

By default Unity serialized all public fields and does not serialize private fields.

There are a few things that are not universally agreed on with c#. One is whether or not to explicitly add the private keyword to private methods and fields since it is optional.

For example these c# statements are equivalent

Member Type implicit explicit
field float _currentHealth; private float _currentHealth;
serialized field [SerializeField] float maxHealth; [SerializeField] private float maxHealth;
method void Awake() private void Awake()
property float CurrentHealth { get; set; } private float CurrentHealth { get; set; }

Project Organization Structure

We will need to devise an organization strategy that works best for us, however there are some standard conventions that we should use. Additionally it is important to be aware that unity has special folders which we will make use of.

Assets
|
└───Art
|	
└───Art

|	|
|	|

Software Package Diagram

Package Diagram

Java to C# Collection Types

Type Java C#
Array int[] int[]
ArrayList ArrayList<int> List<int>
LinkedList LinkedList<int> LinkedList<int>
Dictionary Map<string, int> Dictionary<string,int>
Set HashSet<string> HashMap<string>

software-engineering-capstone's People

Contributors

mharris382 avatar yachtrocker avatar subtledeluge avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.