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.

ActionToggleVisibility.cs 769B

10 years ago
10 years ago
10 years ago
10 years ago
12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace coa4u
  5. {
  6. /// <summary>
  7. /// Instantly hides the target or showes it, if it's hidden. This action does not require the transparency support in shaders.
  8. /// </summary>
  9. class ActionToggleVisibility : ActionInstant
  10. {
  11. public ActionToggleVisibility()
  12. : base()
  13. {
  14. }
  15. public override ActionInstant Clone()
  16. {
  17. return new ActionToggleVisibility();
  18. }
  19. public override ActionInstant Reverse()
  20. {
  21. return new ActionToggleVisibility();
  22. }
  23. public override void Start()
  24. {
  25. base.Start();
  26. renderer.enabled = !renderer.enabled;
  27. }
  28. }
  29. }