// Update is called once per frame void Update() { //if(m_collider.IsTouching(m_otherCollider) ) //{ // Debug.Log("碰到了"); //} //if (Physics.Raycast(transform.position, Vector3.right, 10)) //{ // Debug.Log("There is something in front of the object!"); //} if (CustomCollision.CollisionDetection(this, m_otherColliderBox)) { Debug.Log("AABB碰觸"); } if (Input.GetKey(KeyCode.RightArrow)) { this.transform.Translate(this.transform.right * 3 * Time.deltaTime); } if (Input.GetKey(KeyCode.LeftArrow)) { this.transform.Translate(this.transform.right * -3 * Time.deltaTime); } if (Input.GetKey(KeyCode.UpArrow)) { this.transform.Translate(this.transform.up * 3 * Time.deltaTime); } if (Input.GetKey(KeyCode.DownArrow)) { this.transform.Translate(this.transform.up * -3 * Time.deltaTime); } }