Created
November 19, 2015 08:39
-
-
Save arun02139/06736c1a3f5893732a83 to your computer and use it in GitHub Desktop.
This file contains 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
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEngine.EventSystems; | |
using System.Collections; | |
using NUnit.Framework; | |
public class TurnListTap : MonoBehaviour, IPointerClickHandler | |
{ | |
public Transform Target; | |
bool open; | |
Vector3 originalPosition; | |
void Awake() | |
{ | |
originalPosition = Target.position; | |
} | |
public void OnPointerClick(PointerEventData dt) | |
{ | |
if(open) | |
{ | |
Target.position = originalPosition; | |
open = false; | |
} | |
else | |
{ | |
var skipButton = UIManager.I.FindLastInstance<SkipTurnBtnPUI>(); | |
if(skipButton != null) | |
{ | |
//var w = skipButton.GetComponent<RectTransform>().GetWidth() / 4f; | |
print ("width = " + skipButton.GetComponent<RectTransform>().GetWidth()); | |
Target.position = new Vector3(skipButton.transform.position.x, Target.position.y, Target.position.z); | |
open = true; | |
} | |
} | |
print ("open = " + open); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment