Ejemplo n.º 1
0
		public static string GenerateTransitionMethod(ModuleSettings settings, bool everyPlatformHasUniqueName) {
			
			var platformName = settings.GetPlatformName();
			var className = settings.GetPlatformClassName();

			var file = Resources.Load("UI.Windows/Social/Templates/TemplateTransitionMethod") as TextAsset;
			if (file == null) {
				
				Debug.LogError("Social Template Loading Error: Could not load template 'TemplateTransitionMethod'");
				
				return string.Empty;

			}
			
			var result = string.Empty;
			var multiModules = string.Empty;
			if (everyPlatformHasUniqueName == true) multiModules = className;

			var part = file.text;

			var moduleName = string.Format("UnityEngine.UI.Windows.Plugins.Social.Modules.Impl.{0}.{0}Module", className);

			result +=
				part.Replace("{MODULE_NAME}", moduleName)
					.Replace("{CLASS_NAME}", className)
					.Replace("{MULTI_MODULES_CLASS_NAME}", multiModules)
					.Replace("{PLATFORM_NAME}", platformName);

			return result;

		}
        public static string GenerateTransitionMethod(ModuleSettings settings, bool everyPlatformHasUniqueName)
        {
            var platformName = settings.GetPlatformName();
            var className    = settings.GetPlatformClassName();

            var file = UnityEngine.Resources.Load("UI.Windows/Social/Templates/TemplateTransitionMethod") as TextAsset;

            if (file == null)
            {
                Debug.LogError("Social Template Loading Error: Could not load template 'TemplateTransitionMethod'");

                return(string.Empty);
            }

            var result       = string.Empty;
            var multiModules = string.Empty;

            if (everyPlatformHasUniqueName == true)
            {
                multiModules = className;
            }

            var part = file.text;

            var moduleName = string.Format("UnityEngine.UI.Windows.Plugins.Social.Modules.Impl.{0}.{0}Module", className);

            result +=
                part.Replace("{MODULE_NAME}", moduleName)
                .Replace("{CLASS_NAME}", className)
                .Replace("{MULTI_MODULES_CLASS_NAME}", multiModules)
                .Replace("{PLATFORM_NAME}", platformName);

            return(result);
        }