Tanoda
ReadonlyCacheEntry.cs
Go to the documentation of this file.
1using System;
2
4{
6 {
7 public readonly object Object;
8 private readonly Type _type;
9 private string _tostringCache;
10
11 public ReadonlyCacheEntry(string name, object obj) : base(name)
12 {
13 Object = obj;
14 _type = obj.GetType();
15 }
16
17 public override object GetValueToCache()
18 {
19 return Object;
20 }
21
22 protected override bool OnSetValue(object newValue)
23 {
24 return false;
25 }
26
27 public override Type Type()
28 {
29 return _type;
30 }
31
32 public override bool CanSetValue()
33 {
34 return false;
35 }
36
37 public override string ToString()
38 {
39 return _tostringCache ?? (_tostringCache = Name() + " | " + Object);
40 }
41 }
42}
string Name()
override object GetValueToCache()
ReadonlyCacheEntry(string name, object obj)
override bool OnSetValue(object newValue)
readonly object Object
override bool CanSetValue()
override string ToString()
override Type Type()
UnityEngine.Object Object