Search Feedback

0
votes

Simple Generic Class Serialization

Editor

-

-

-- Hi, I'm struggling to make something "simple".

-- I have a generic class for a StateMachine:

class State<TEnumState, TEnumTransition>

-- if I create a List<TEnumState> inside it Unity serialize it for me but if I create another class

class TransitionState<TEnumState, TEnumTransition>

-- and inside class State I did something like

public TransitionState<TEnumState, TEnumTransition> m_Transitions

-- Unity lost itself and can't serialize. But if it recognize as a List, can't it recognize when passing by to another class the same type already recognized?

Can you do it?

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(9241)

2D

(233)

Ads

(42)

AI & Navigation

(70)

Analytics

(103)

Animation

(318)

Asset Store

(234)

Assets

(493)

Audio

(158)

Cloud Build

(98)

Collaborate

(33)

Docs & Tutorials

(202)

Editor

(2136)

Everyplay

(13)

Game Performance Reporting

(15)

General

(825)

Graphics

(783)

GUI

(371)

Input

(147)

Licensing

(76)

Networking

(163)

Physics

(346)

Platforms

(407)

Profiling & Optimization

(71)

Runtime

(164)

Scripting

(1030)

Terrain

(151)

WebGL

(132)