Beispiel #1
0
        void Start()
        {
            Color = Color.yellow;

            if (resource == null)
            {
                resource = ResourcePool.RentDisplay <LineResource>(Transform);
            }

            arCameraTransform = arCamera.transform;
            Transform.SetParentLocal(TfListener.OriginFrame.Transform);
            ARController.ARCameraViewChanged += OnARCameraViewChanged;
            gameObject.SetActive(!ARController.IsVisible);
        }
Beispiel #2
0
        void Awake()
        {
            mesh  = new Mesh();
            plane = GetComponent <ARPlane>();

            lines              = ResourcePool.RentDisplay <LineResource>();
            lines.Visible      = false;
            lines.ElementScale = 0.005f;
            lines.Tint         = Color.yellow;

            MeshFilter meshFilter = GetComponent <MeshFilter>();

            meshFilter.sharedMesh = mesh;

            meshCollider            = GetComponent <MeshCollider>();
            meshCollider.sharedMesh = mesh;

            meshRenderer = GetComponent <MeshRenderer>();

            //isEnabled = true;

            plane.boundaryChanged            += OnBoundaryChanged;
            ARController.ARCameraViewChanged += OnARCameraViewChanged;
        }