File tree 1 file changed +11
-1
lines changed
Assets/SO Architecture/References
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
using UnityEngine ;
2
2
3
3
[ System . Serializable ]
4
- public abstract class BaseReference < TBase , TVariable > : BaseReference where TVariable : BaseVariable < TBase >
4
+ public class BaseReference < TBase , TVariable > : BaseReference where TVariable : BaseVariable < TBase >
5
5
{
6
6
public BaseReference ( ) { }
7
7
public BaseReference ( TBase baseValue )
@@ -35,6 +35,16 @@ public bool IsValueDefined
35
35
return _useConstant || _variable != null ;
36
36
}
37
37
}
38
+
39
+ public BaseReference CreateCopy ( )
40
+ {
41
+ BaseReference < TBase , TVariable > copy = ( BaseReference < TBase , TVariable > ) System . Activator . CreateInstance ( GetType ( ) ) ;
42
+ copy . _useConstant = _useConstant ;
43
+ copy . _constantValue = _constantValue ;
44
+ copy . _variable = _variable ;
45
+
46
+ return copy ;
47
+ }
38
48
public void AddListener ( IGameEventListener listener )
39
49
{
40
50
if ( _variable != null )
You can’t perform that action at this time.
0 commit comments