Advertisement
Guest User

Radial Menu Element

a guest
Jun 17th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3.  
  4. public class RadialMenuElement : InterfaceElement
  5. {
  6.     public RectTransform myRect;
  7.     public Image myImage;
  8.     public Outline myOutline;
  9.  
  10.     public void StartElement(Vector2 outlineSize, float zRotation, Vector3 position, float fillAmount)
  11.     {
  12.         myRect.position = position;
  13.         myOutline.effectDistance = outlineSize;
  14.         myImage.fillAmount = fillAmount/360f;
  15.         myRect.rotation = Quaternion.Euler(new Vector3(0,0,zRotation));
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement