public SmartPhoneTouchData(int fingerId, float deltaTime, List <Vector2> screenPositions, List <Vector2> worldPositions, SmartPhoneTouchMode touchMode) { this.fingerId = fingerId; this.deltaTime = deltaTime; this.touchMode = touchMode; this.screenPositions = new List <Vector2>(); this.screenPositions.AddRange(screenPositions); this.worldPositions = new List <Vector2>(); this.worldPositions.AddRange(worldPositions); }
public void Classify() { var classifier = new SmartPhoneTouchClassifier(); if (touchMode == SmartPhoneTouchMode.None) { var result = classifier.Classify(screenPositions, deltaTime, isEnd, hitObjects); if (result.inedex != -1) { this.touchMode = result.touchMode; this.reciever = hitObjects[result.inedex]; this.isStartNow = true; } } }
private bool checkState(SmartPhoneTouchReciever reciever, SmartPhoneTouchMode mode) { if (mode == SmartPhoneTouchMode.Tap) { return(reciever.checkTap); } if (mode == SmartPhoneTouchMode.Flick) { return(reciever.checkFlick); } if (mode == SmartPhoneTouchMode.LongTouch) { return(reciever.checkLongTouch); } return(false); }
public int GetRecieverIndex(List <SmartPhoneTouchReciever> hitObjects, SmartPhoneTouchMode mode) { int index = -1; for (int i = 0; i < hitObjects.Count; i++) { if (checkState(hitObjects[i], mode)) { if (index == -1 || IsFront(hitObjects[i], hitObjects[index])) { index = i; } } } return(index); }
public Result(int index, SmartPhoneTouchMode touchMode) { this.inedex = index; this.touchMode = touchMode; }