コード例 #1
0
 void OnMouseDown()
 {
     Tableaux.Instance().PlaySoundOnClick();
     GetComponent <Rigidbody>().useGravity  = false;
     GetComponent <Rigidbody>().isKinematic = true;
     distance   = Vector3.Distance(transform.position, Camera.main.transform.position);
     startPos   = Input.mousePosition;
     startPos.z = transform.position.z - Camera.main.transform.position.z;
     startPos   = Camera.main.ScreenToWorldPoint(startPos);
     Debug.Log("the mouse down pos is " + startPos);
     IsDrag = true;
 }
コード例 #2
0
    void OnTriggerEnter(Collider other)
    {
        Debug.Log("Coucou");

        if (other.gameObject.tag == gameObject.tag && other.gameObject.tag == ("A"))
        {
            Tableaux.Instance().CheckWin();
            FormeAMur.SetActive(true);
            Destroy(gameObject);
        }

        if (other.gameObject.tag == gameObject.tag && other.gameObject.tag == ("B"))
        {
            Tableaux.Instance().CheckWin();
            FormeBMur.SetActive(true);
            Destroy(gameObject);
        }
        if (other.gameObject.tag == gameObject.tag && other.gameObject.tag == ("C"))
        {
            Tableaux.Instance().CheckWin();
            FormeCMur.SetActive(true);
            Destroy(gameObject);
        }

        if (other.gameObject.tag == gameObject.tag && other.gameObject.tag == ("D"))
        {
            Tableaux.Instance().CheckWin();
            FormeDMur.SetActive(true);
            Destroy(gameObject);
        }

        if (other.gameObject.tag == gameObject.tag && other.gameObject.tag == ("E"))
        {
            Tableaux.Instance().CheckWin();
            FormeEMur.SetActive(true);
            Destroy(gameObject);
        }

        if (other.gameObject.tag == gameObject.tag && other.gameObject.tag == ("F"))
        {
            Tableaux.Instance().CheckWin();
            FormeFMur.SetActive(true);
            Destroy(gameObject);
        }

        if (other.gameObject.tag == gameObject.tag && other.gameObject.tag == ("D2"))
        {
            Tableaux.Instance().CheckWin();
            FormeD2Mur.SetActive(true);
            Destroy(gameObject);
        }

        if (other.gameObject.tag == gameObject.tag && other.gameObject.tag == ("B2"))
        {
            Tableaux.Instance().CheckWin();
            FormeB2Mur.SetActive(true);
            Destroy(gameObject);
        }
        if (other.gameObject.tag == gameObject.tag && other.gameObject.tag == ("A2"))
        {
            Tableaux.Instance().CheckWin();
            FormeA2Mur.SetActive(true);
            Destroy(gameObject);
        }
    }