Tanoda
ListCacheEntry.cs
Go to the documentation of this file.
1
using
System;
2
using
System.Collections;
3
4
namespace
RuntimeUnityEditor.Core.Inspector.Entries
5
{
6
public
class
ListCacheEntry
:
CacheEntryBase
7
{
8
private
Type
_type;
9
private
readonly IList _list;
10
private
readonly
int
_index;
11
12
public
ListCacheEntry
(IList container,
int
index) : base(
ReadonlyListCacheEntry
.GetListItemName(index))
13
{
14
_index = index;
15
_list = container;
16
}
17
18
public
override
object
GetValueToCache
()
19
{
20
return
_list.Count > _index ? _list[_index] :
"ERROR: The list was changed while browsing!"
;
21
}
22
23
protected
override
bool
OnSetValue
(
object
newValue)
24
{
25
if
(
CanSetValue
())
26
{
27
_list[_index] = newValue;
28
_type =
null
;
29
return
true
;
30
}
31
32
return
false
;
33
}
34
35
public
override
Type
Type
()
36
{
37
return
_type ?? (_type =
GetValue
().GetType());
38
}
39
40
public
override
bool
CanSetValue
()
41
{
42
return
!_list.IsReadOnly;
43
}
44
}
45
}
RuntimeUnityEditor.Core.Inspector.Entries.CacheEntryBase
Definition:
CacheEntryBase.cs:7
RuntimeUnityEditor.Core.Inspector.Entries.CacheEntryBase.GetValue
virtual object GetValue()
Definition:
CacheEntryBase.cs:34
RuntimeUnityEditor.Core.Inspector.Entries.ListCacheEntry
Definition:
ListCacheEntry.cs:7
RuntimeUnityEditor.Core.Inspector.Entries.ListCacheEntry.CanSetValue
override bool CanSetValue()
Definition:
ListCacheEntry.cs:40
RuntimeUnityEditor.Core.Inspector.Entries.ListCacheEntry.Type
override Type Type()
Definition:
ListCacheEntry.cs:35
RuntimeUnityEditor.Core.Inspector.Entries.ListCacheEntry.ListCacheEntry
ListCacheEntry(IList container, int index)
Definition:
ListCacheEntry.cs:12
RuntimeUnityEditor.Core.Inspector.Entries.ListCacheEntry.OnSetValue
override bool OnSetValue(object newValue)
Definition:
ListCacheEntry.cs:23
RuntimeUnityEditor.Core.Inspector.Entries.ListCacheEntry.GetValueToCache
override object GetValueToCache()
Definition:
ListCacheEntry.cs:18
RuntimeUnityEditor.Core.Inspector.Entries.ReadonlyListCacheEntry
Definition:
ReadonlyListCacheEntry.cs:6
RuntimeUnityEditor.Core.Inspector.Entries
Definition:
CacheEntryBase.cs:5
Source
Assets
Scripts
BepinRUE
Inspector
Entries
Contents
ListCacheEntry.cs
Generated by
1.9.3