public void Untouch(FingerTipCollider finger) { if (unTouch != null) { unTouch.Invoke(finger); } }
public void UnsetDribbleOverride(FingerTipCollider ftc) { /*if (ftc.pocb) * { * ftc.pocb.DribbleOverride = false; * Debug.Log("DROB"); * }*/ }
private void RegisterHelper(FingerTipCollider ftc, bool whatever) { if (ftc.index % 2 == 1 && ftc.index < 10) { touching[ftc.index / 2] = whatever; pulse[ftc.index / 2].gameObject.SetActive(whatever); } }
private void OnCollisionExit(Collision collision) { FingerTipCollider ftc = collision.gameObject.GetComponent <FingerTipCollider>(); if (ftc != null && ftc.isTip) { ftc.pocb.PaintAmp = null; } }
public void RegisterBottom(FingerTipCollider ftc) { bottomFTCs.Add(ftc); bottomRegister++; if (bottom) { bottom.angularXMotion = ConfigurableJointMotion.Free; } }
private void OnCollisionStay(Collision collision) { FingerTipCollider ftc = collision.gameObject.GetComponent <FingerTipCollider>(); if (ftc != null /*&& ftc.PaintColor != Color.clear*/) { if (ftc.PaintColor != Color.clear && ftc.PaintColor != FingerPaint.eraseColor) { if (!source.isPlaying) { source.Play(); } elapsed = 0.0f; GameObject brushObject = Instantiate(brush); //brushObject.layer = paintLayer; brushObject.transform.parent = null; SpriteRenderer sr = brushObject.GetComponent <SpriteRenderer>(); sr.color = ftc.PaintColor; sr.sortingOrder = this.transform.childCount; //Find canvas plane RaycastHit hit; Ray temp = new Ray(collision.contacts[0].point - collision.contacts[0].normal * dist, collision.contacts[0].normal); Physics.Raycast(temp, out hit, dist * 2, paintMask); brushObject.transform.position = hit.point - collision.contacts[0].normal * 0.001f; brushObject.transform.rotation = Quaternion.LookRotation(collision.contacts[0].normal); brushObject.transform.parent = this.transform; brushObject.transform.localScale = Vector3.one * brushSize; } if (ftc.vocb != null) { ftc.vocb.PaintEffect = effect; } //ftc.pocb.Amplitude = (byte)(80 + ftc.rb.velocity.magnitude * scale); if (ftc.pocb != null) { ftc.pocb.PaintAmp = 255; ftc.rend.enabled = false; } } if (this.transform.childCount > maxDots) { //If we reach the max brushes available, flatten the texture and clear the brushes //brushCursor.SetActive(false); //saving = true; Invoke("SaveTexture", 0.1f); } }
public void RegisterTop(FingerTipCollider ftc) { topFTCs.Add(ftc); topRegister++; if (top) { top.angularXMotion = ConfigurableJointMotion.Free; } }
public void Touch(FingerTipCollider finger) { if (onTouch != null) { onTouch.Invoke(finger); } //if (finger.index == 1) //{ //index == 1 means index finger // onPoked.Invoke(); //} }
public void SetDribbleOverride(FingerTipCollider ftc) { if (ftc.pocb && ftc.vocb) { ftc.pocb.DribbleOverride = true; ftc.pocb.DribbleWait = 0f; ftc.pocb.Amplitude = this.Amplitude; ftc.vocb.VibrationEffect = this.VibrationEffect; //Debug.Log("DRIB"); } }
private void OnCollisionEnter(Collision collision) { //Debug.Log("Touched rag!!!!!!"); FingerTipCollider ftc = collision.gameObject.GetComponent <FingerTipCollider>(); if (ftc != null && ftc.isTip) { ftc.pocb.PaintAmp = 200; ftc.PaintColor = Color.clear; } }
private void TryErase(GameObject go) { if (go != null) { FingerTipCollider ftc = go.gameObject.GetComponent <FingerTipCollider>(); if (ftc != null && ftc.isTip && ftc.PaintColor == FingerPaint.eraseColor) { //Debug.Log("ERASED"); Destroy(this.gameObject); } } }
private void OnCollisionEnter(Collision collision) { FingerTipCollider ftc = collision.gameObject.GetComponent <FingerTipCollider>(); if (ftc != null && ftc.isTip) { ftc.PaintColor = erase ? eraseColor : rend.material.color; if (source) { source.pitch = Random.Range(0.8f, 1.2f); source.Play(); } } }
public void UnregisterBottom(FingerTipCollider ftc) { bottomFTCs.Remove(ftc); bottomRegister--; Quaternion temp = BottomDial.rotation; if (bottomRegister <= 0) { //bottom.targetRotation = temp; //bottom.angularXMotion = ConfigurableJointMotion.Locked; } }
private void OnCollisionExit(Collision collision) { FingerTipCollider ftc = collision.gameObject.GetComponent <FingerTipCollider>(); if (ftc != null /*&& ftc.PaintColor != Color.clear*/) { if (ftc.vocb != null) { ftc.vocb.PaintEffect = null; } if (ftc.pocb != null) { ftc.pocb.Amplitude = null; ftc.pocb.PaintAmp = null; } } }
public void UnregisterTop(FingerTipCollider ftc) { topRegister--; topFTCs.Remove(ftc); }
public void Register(FingerTipCollider ftc) { RegisterHelper(ftc, true); }
public void Unregister(FingerTipCollider ftc) { RegisterHelper(ftc, false); }