Beispiel #1
0
 /// <summary>
 /// Contructor in case of the very first generation of an AnimatorAccess class. On subsequent generations
 /// ClassElementsBuilder (GameObject go) is called.
 /// </summary>
 /// <param name="go">GameObject to generate an AnimatorAccess class for.</param>
 /// <param name="fileName">File name where to save the file. A subdirectory 'Generated' is recommended to
 /// emphasize that this code shouldn't be edited.</param>
 public ClassElementsBuilder(GameObject go, string fileName)
 {
     className            = Path.GetFileNameWithoutExtension(fileName);
     config               = ConfigFactory.Get(className);
     templateEngine       = new SmartFormatTemplateEngine();
     builder              = new AnimatorCodeElementsBuilder(go, className, config);
     existingClassBuilder = new ReflectionCodeElementsBuilder("Assembly-CSharp", config.DefaultNamespace, className);
 }
Beispiel #2
0
        /// <summary>
        /// Udpate contructor.
        /// </summary>
        /// <param name="go">GameObject to generate an AnimatorAccess class for.</param>
        public ClassElementsBuilder(GameObject go)
        {
            BaseAnimatorAccess animatorAccess = go.GetComponent <BaseAnimatorAccess> ();

            if (animatorAccess != null)
            {
                existingClassBuilder = new ReflectionCodeElementsBuilder(animatorAccess);
                className            = existingClassBuilder.ClassName;
                config                     = ConfigFactory.Get(className);
                templateEngine             = new SmartFormatTemplateEngine();
                builder                    = new AnimatorCodeElementsBuilder(go, className, config);
                existingAllTransitionsHash = animatorAccess.AllTransitionsHash;
            }
            else
            {
                Logger.Error("Cannot access component BaseAnimatorAccess from object " + go.name);
            }
        }
		/// <summary>
		/// Contructor in case of the very first generation of an AnimatorAccess class. On subsequent generations 
		/// ClassElementsBuilder (GameObject go) is called.
		/// </summary>
		/// <param name="go">GameObject to generate an AnimatorAccess class for.</param>
		/// <param name="fileName">File name where to save the file. A subdirectory 'Generated' is recommended to 
		/// emphasize that this code shouldn't be edited.</param>
		public ClassElementsBuilder (GameObject go, string fileName)
		{
			className = Path.GetFileNameWithoutExtension (fileName);
			config = ConfigFactory.Get (className);
			templateEngine = new SmartFormatTemplateEngine ();
			builder = new AnimatorCodeElementsBuilder (go, className, config);
			existingClassBuilder = new ReflectionCodeElementsBuilder ("Assembly-CSharp", config.DefaultNamespace, className);
		}
		/// <summary>
		/// Udpate contructor.
		/// </summary>
		/// <param name="go">GameObject to generate an AnimatorAccess class for.</param>
		public ClassElementsBuilder (GameObject go)
		{
			BaseAnimatorAccess animatorAccess = go.GetComponent<BaseAnimatorAccess> ();
			if (animatorAccess != null) {
				existingClassBuilder = new ReflectionCodeElementsBuilder (animatorAccess);
				className = existingClassBuilder.ClassName;
				config = ConfigFactory.Get (className);
				templateEngine = new SmartFormatTemplateEngine ();
				builder = new AnimatorCodeElementsBuilder (go, className, config);
				existingAllTransitionsHash = animatorAccess.AllTransitionsHash;
			} else {
				Logger.Error ("Cannot access component BaseAnimatorAccess from object " + go.name);
			}
		}