You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

ActionSetTint.cs 434B

10 years ago
10 years ago
123456789101112131415161718192021
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. class ActionSetTint : Action
  5. {
  6. public Vector4 color;
  7. protected const float coeff = 1F / 255F;
  8. public ActionSetTint(Vector4 tgtColor)
  9. : base()
  10. {
  11. color = tgtColor * coeff;
  12. }
  13. public override void start()
  14. {
  15. base.start();
  16. renderer.material.color = new Color(color[0], color[1], color[2], color[3]);
  17. }
  18. }