Example #1
0
    private void UpdateTile(GameObject target)
    {
        int touch = CloudAnchorController.GetInstance().data.touch;

        if (touch == 0)
        {
            target.GetComponent <MeshRenderer>().material.color = Color.green;
            touch = 1;
        }
        else
        {
            target.GetComponent <MeshRenderer>().material.color = Color.white;
            touch = 0;
        }

        if (CloudAnchorController.GetInstance().m_CurrentMode == CloudAnchorController.ApplicationMode.Hosting)
        {
            CloudAnchorController.GetInstance().RoomSharingServer.SentTouchToClient(touch);
        }
        else
        {
            CloudAnchorController.GetInstance().roomSharingClient.SendTouchToHost(touch);
        }

        CloudAnchorController.GetInstance().data.touch = touch;
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (tile != null)
        {
            if (CloudAnchorController.GetInstance().data.touch == 0)
            {
                tile.GetComponent <MeshRenderer>().material.color = Color.white;
            }
            else
            {
                tile.GetComponent <MeshRenderer>().material.color = Color.green;
            }
        }

        if (OnTouchDown())
        {
            return;
        }

        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit = new RaycastHit();
            if (Physics.Raycast(ray, out hit, rayDistance))
            {
                UpdateTile(hit.collider.gameObject);
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     //hitCounter=0;
     //treeScale = 1f;
     cloudAnchorController = GameObject.FindGameObjectWithTag("CloudController").GetComponent <CloudAnchorController>();
     treeScale             = 1f;
     if (cloudAnchorController.m_CurrentMode != CloudAnchorController.ApplicationMode.Hosting)
     {
         if (cloudAnchorController.m_CurrentMode == CloudAnchorController.ApplicationMode.Ready)
         {
             inResolveMode = true;
         }
     }
     //Debug.Log(transform.localScale);
 }
Example #4
0
 void Awake()
 {
     arkitCam  = CloudAnchorController.GetInstance().arkitCam;
     arcoreCam = CloudAnchorController.GetInstance().arcoreCam;
 }