Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.

38 rindas
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. }