No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
Este repositorio está archivado. Puede ver los archivos y clonarlo, pero no puede subir cambios o reportar incidencias ni pedir Pull Requests.

38 líneas
919B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace coa4u
  5. {
  6. /// <summary>
  7. /// Instantly tints the target to the given color.
  8. /// </summary>
  9. class ActionSetTint : ActionInstant
  10. {
  11. public Vector4 color;
  12. protected const float coeff = 1F / 255F;
  13. public ActionSetTint(Vector4 tgtColor)
  14. : base()
  15. {
  16. color = tgtColor * coeff;
  17. }
  18. /// <summary>
  19. /// Returns a copy of the action.
  20. /// </summary>
  21. public override ActionInstant clone()
  22. {
  23. return new ActionSetTint(color * 255F);
  24. }
  25. /// <summary>
  26. /// This method is called at the action start.
  27. /// </summary>
  28. public override void start()
  29. {
  30. base.start();
  31. renderer.material.color = new Color(color[0], color[1], color[2], color[3]);
  32. }
  33. }
  34. }