WeaponAtDisplay.cs 516 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class WeaponAtDisplay : MonoBehaviour {
  5. public int weaponID;
  6. public int rotationSpeed;
  7. public MeshRenderer label;
  8. public Material redFontMaterial;
  9. public Material blackFontMaterial;
  10. void FixedUpdate ()
  11. {
  12. transform.Rotate (Vector3.up * Time.fixedDeltaTime * rotationSpeed);
  13. }
  14. void OnTriggerEnter ()
  15. {
  16. label.material = redFontMaterial;
  17. }
  18. void OnTriggerExit ()
  19. {
  20. label.material = blackFontMaterial;
  21. }
  22. }