Last active
June 17, 2016 06:42
-
-
Save gegagome/0dd43d9bf4db02274732d88b01bf38a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<GenericMenuOptions> _sceneButtons; | |
public bool _isMenuExposed = false; | |
public const float MENU_ICON_HEIGHT = 81.7f; | |
public const float GEAR_ROTATION_AMOUNT = -120f; | |
public const float GEAR_ROTATION_LENGTH = 0.5f; | |
Vector2 _gearIconPos = new Vector2(45f, -50.85f); | |
Vector2 _iconSize = new Vector2(70f, 81.7f); | |
Vector2 _pivot = new Vector2(0.5f, 0.5f); | |
Sequence _menuExposer; | |
void Start () { | |
InitializeThisTween(); | |
} | |
void InitializeThisTween () { | |
_menuExposer = DOTween.Sequence ().SetAutoKill (false).Pause (); | |
_menuExposer.Append(_sceneButtons[0].button.transform.DORotate(new Vector3(0f, 0f, GEAR_ROTATION_AMOUNT), GEAR_ROTATION_LENGTH)); | |
for (int i = 1; i < _sceneButtons.Count; i++) { | |
_menuExposer.Insert(0.25f * (i - 1), _sceneButtons[i].buttonRect.DOAnchorPos(_sceneButtons[i].exposedPosition, | |
0.25f, | |
false)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment