Exemple #1
0
 public void SetSpace(NotAndCrossSpace NS, bool?state)
 {
     //Debug.Log("SetSpace Called for: " + NS.name);
     for (int i = 0; i < 9; i++)
     {
         //Debug.Log("Space " + i + " : " + NotsAndCrosses[i].GetComponent<NotAndCrossSpace>().name + " ?= " + NS.name);
         //Debug.Log("Space " + i + " : " + Object.ReferenceEquals(NotsAndCrosses[i].GetComponent<NotAndCrossSpace>(), NS));
         //Debug.Log("Space " + i + " : " + NotsAndCrosses[i].GetHashCode() + " ?= " + NS.GetHashCode());
         //Debug.Log("State: " + state);
         if (Object.ReferenceEquals(NotsAndCrosses[i].GetComponent <NotAndCrossSpace>(), NS) &&
             state == WhoseTurn)
         {
             //NS.ChangeState(state);
             Set(i, state);
         }
     }
 }
    public void AltClick()
    {
        if (Input.GetMouseButton(1))
        {
            Ray          ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit2D hit = Physics2D.GetRayIntersection(ray);

            if (hit.transform != null)
            {
                GameObject       obj = hit.collider.gameObject;
                NotAndCrossSpace NCS = obj.GetComponent <NotAndCrossSpace>();
                if (NCS != null)
                {
                    // We have contact!  We can tell it what to do now
                    tManager.SetSpace(NCS, !State);
                }
            }
        }
    }
    private void CheckClick()
    {
        if (Input.GetAxis("Fire1") > 0)
        {
            Ray          ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit2D hit = Physics2D.GetRayIntersection(ray);

            if (hit.transform != null)
            {
                //Debug.Log("hit: " + hit.ToString());
                GameObject       obj = hit.collider.gameObject;
                NotAndCrossSpace NCS = obj.GetComponent <NotAndCrossSpace>();
                if (NCS != null)
                {
                    // We have contact!  We can tell it what to do now
                    tManager.SetSpace(NCS, State);
                }
            }
        }
    }