void ScanBubbleTouch() { if (temp.Count > 0) { contactCount = TouchObjPool.GetInstance().CheckForContact(bubbleRect, true); } tempSize = bubbleRect.sizeDelta; if (contactCount == 0) { bubbleSize = new Vector2(maxSize, maxSize); tempSize = Vector2.Lerp(tempSize, bubbleSize, Time.deltaTime); } else if (contactCount > 1) { bubbleSize = new Vector2(minSize, minSize); tempSize = Vector2.Lerp(tempSize, bubbleSize, Time.deltaTime); } else if (contactCount == 1) { selectedObj = TouchObjPool.GetInstance().GetChosen(bubbleRect); } bubbleRect.sizeDelta = tempSize; }
void ScanCursorTouch() { if (temp.Count > 0) { contactCount = TouchObjPool.GetInstance().CheckForContact(cursorRect); selectedObj = TouchObjPool.GetInstance().GetChosen(cursorRect); } }
public TouchObjects GetChosen(RectTransform inRect, bool isBubble = false) { TouchObjects result = null; foreach (TouchObjects obj in objList) { if (obj.CheckHit(inRect, isBubble)) { result = obj; } } return(result); }
public void BubbleMode(List <Target> inList, bool targetGravity = false) { selectedObj = null; if (!bubbleRect.gameObject.activeSelf && !targetGravity) { bubbleRect.gameObject.SetActive(true); } contactCount = 0; if (!touchInitialised) { temp = inList; if (temp.Count > 0) { foreach (Target t in temp) { TouchObjPool.GetInstance().SetPoolActive(t); } touchInitialised = true; } } }