void drawCustomInspector(string tag, GameObject obj) { string tagClass = "Custom" + char.ToUpper(tag[0]) + tag.Substring(1); switch (tagClass) { case "CustomEnemy": CustomEnemy.OnCustomInspectorGUI(obj); break; case "CustomTest": CustomTest.OnCustomInspectorGUI(obj); break; } /* * Possible Future Implementation - * Pre-define the 'Custom' part like do now * Convert String->Class So can call: "CustomTag".OnCustomInspectorGUI(obj) * "OnCustomInspectorGUI" would be a Pre-defined method common to all Custom classes * 'obj' would be the GameObject passed into method where class type is found in component * * Error Checking - * When pass obj to OnCustomInspectorGUI and try to 'find' component, it won't be found * This means 1. Improper Tag on Object, 2. Script missing on Object */ }
static void Main(string[] args) { var tc = new CustomTest(); ITest tc1 = tc; ITestBase <CustomTest> tb = new TestBase <CustomTest>(); var tb1 = (ITestBase <Test>)tb; var s1 = "Admin"; var s2 = "Employee"; var c1 = s1.GetHashCode(); var c2 = s2.GetHashCode(); var config = new ConfigurationOptions(); config.Password = "******"; //ICacheProvider cacheProvider = new RedisCacheProvider("localhost:6379,password=zhaokun"); ICacheProvider cacheProvider = new MemoryCacheProvider(); CacheManager.SetCacheProvider(cacheProvider); CacheManager.GetGlobalCache().Set("test", "test"); CacheManager.GetCache <Program>().Set("test", "test"); CacheManager.GetCache <Program>().Set("test1", "test"); CacheManager.GetCache <Program>().Set("test2", "test"); CacheManager.GetCache <Program>().Set("test3", "test"); CacheManager.GetCache(nameof(Program)).Set("test", "test1"); System.Console.WriteLine(CacheManager.GetGlobalCache().Get <string>("test")); System.Console.WriteLine(CacheManager.GetCache(nameof(Program)).Get <string>("test")); TestMethod1(); TestMethod2(); TestMethod3(); TestMethod4(); //TestMethod5(); System.Console.ReadKey(); }