コード例 #1
0
 public void Untouch(FingerTipCollider finger)
 {
     if (unTouch != null)
     {
         unTouch.Invoke(finger);
     }
 }
コード例 #2
0
 public void UnsetDribbleOverride(FingerTipCollider ftc)
 {
     /*if (ftc.pocb)
      * {
      *  ftc.pocb.DribbleOverride = false;
      *  Debug.Log("DROB");
      * }*/
 }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
    private void OnCollisionExit(Collision collision)
    {
        FingerTipCollider ftc = collision.gameObject.GetComponent <FingerTipCollider>();

        if (ftc != null && ftc.isTip)
        {
            ftc.pocb.PaintAmp = null;
        }
    }
コード例 #5
0
    public void RegisterBottom(FingerTipCollider ftc)
    {
        bottomFTCs.Add(ftc);

        bottomRegister++;
        if (bottom)
        {
            bottom.angularXMotion = ConfigurableJointMotion.Free;
        }
    }
コード例 #6
0
    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);
        }
    }
コード例 #7
0
    public void RegisterTop(FingerTipCollider ftc)
    {
        topFTCs.Add(ftc);

        topRegister++;

        if (top)
        {
            top.angularXMotion = ConfigurableJointMotion.Free;
        }
    }
コード例 #8
0
 public void Touch(FingerTipCollider finger)
 {
     if (onTouch != null)
     {
         onTouch.Invoke(finger);
     }
     //if (finger.index == 1)
     //{ //index == 1 means index finger
     //    onPoked.Invoke();
     //}
 }
コード例 #9
0
 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");
     }
 }
コード例 #10
0
    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;
        }
    }
コード例 #11
0
 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);
         }
     }
 }
コード例 #12
0
ファイル: FingerPaint.cs プロジェクト: mrhegemon/climate007
    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();
            }
        }
    }
コード例 #13
0
    public void UnregisterBottom(FingerTipCollider ftc)
    {
        bottomFTCs.Remove(ftc);

        bottomRegister--;

        Quaternion temp = BottomDial.rotation;

        if (bottomRegister <= 0)
        {
            //bottom.targetRotation = temp;
            //bottom.angularXMotion = ConfigurableJointMotion.Locked;
        }
    }
コード例 #14
0
    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;
            }
        }
    }
コード例 #15
0
 public void UnregisterTop(FingerTipCollider ftc)
 {
     topRegister--;
     topFTCs.Remove(ftc);
 }
コード例 #16
0
 public void Register(FingerTipCollider ftc)
 {
     RegisterHelper(ftc, true);
 }
コード例 #17
0
 public void Unregister(FingerTipCollider ftc)
 {
     RegisterHelper(ftc, false);
 }