This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature | Record (Limited Support) | |
---|---|---|
Type | Reference Type | |
Mutability | Immutable (potentially in future) | |
Complexity | More concise syntax for data-centric classes (limited use in Unity) | |
Memory Usage | Potentially less efficient than structs for small data (Unity context) | |
Unity Focus | Not fully supported yet | |
Performance | Potentially slower than structs, but with benefits (future) | |
Data Access | Reference indirection (slower) | |
Built-in Functionalities | Equality comparison, Hashing (potential benefit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature | Class | |
---|---|---|
Type | Reference Type | |
Mutability | Mutable | |
Complexity | Can be complex with inheritance and methods | |
Memory Usage | Less efficient for frequently copied large structs | |
Unity Focus | Less common | |
Performance | Slowest | |
Data Access | Reference indirection (slower) | |
Built-in Functionalities | No |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature | Struct | |
---|---|---|
Type | Value Type | |
Mutability | Mutable | |
Complexity | Simpler, for data grouping | |
Memory Usage | Efficient for small data | |
Unity Focus | Preferred for performance-critical data | |
Performance | Generally fastest for small data | |
Data Access | Direct access | |
Built-in Functionalities | No |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature | Struct | Class | Record (Limited Support) | |
---|---|---|---|---|
Type | Value Type | Reference Type | Reference Type | |
Mutability | Mutable | Mutable | Immutable (potentially in future) | |
Complexity | Simpler, for data grouping | Can be complex with inheritance and methods | More concise syntax for data-centric classes (limited use in Unity) | |
Memory Usage | Efficient for small data | Less efficient for frequently copied large structs | Potentially less efficient than structs for small data (Unity context) | |
Unity Focus | Preferred for performance-critical data | Less common | Not fully supported yet | |
Performance | Generally fastest for small data | Slowest | Potentially slower than structs, but with benefits (future) | |
Data Access | Direct access | Reference indirection (slower) | Reference indirection (slower) | |
Built-in Functionalities | No | No | Equality comparison, Hashing (potential benefit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using UnityEngine; | |
namespace JsonDeserializeExample.Scripts | |
{ | |
public enum VehicleType | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using UnityEngine; | |
namespace JsonDeserializeExample.Scripts | |
{ | |
public enum VehicleType | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Newtonsoft.Json; | |
using UnityEngine; | |
namespace JsonDeserializeExample.Scripts | |
{ | |
public enum VehicleType | |
{ | |
Default, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
//using Sirenix.OdinInspector; | |
using UnityEngine; | |
[Flags] | |
public enum SoldierType | |
{ | |
None = 0, | |
Private = 1, | |
Corporal = 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using Sirenix.OdinInspector; | |
using UnityEditor; | |
using UnityEditor.Presets; | |
using UnityEngine; | |
using UnityEngine.Serialization; | |
namespace PresetEditor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StartSceneWindow : EditorWindow | |
{ | |
private const string ScenePath = "Assets/Core/Scenes/MainScene.unity"; | |
private void OnGUI() | |
{ | |
EditorSceneManager.playModeStartScene = (SceneAsset)EditorGUILayout.ObjectField(new GUIContent("Start Scene"), | |
EditorSceneManager.playModeStartScene, typeof(SceneAsset),false); | |
if (GUILayout.Button("Set as Start Scene")) | |
SetPlayModeStartScene(ScenePath); |
NewerOlder