/*=============================================================================== Copyright (C) 2022 Immersal - Part of Hexagon. All Rights Reserved. This file is part of the Immersal SDK. The Immersal SDK cannot be copied, distributed, or made available to third-parties for commercial purposes without written permission of Immersal Ltd. Contact sdk@immersal.com for licensing requests. ===============================================================================*/ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; using Immersal.AR; namespace Immersal.Samples.Navigation { [RequireComponent(typeof(Button))] public class AddNode : MonoBehaviour, IPointerDownHandler, IPointerUpHandler { [SerializeField] private GameObject waypointObject = null; [SerializeField] private GameObject targetObject = null; [SerializeField] private Material overrideMaterial = null; private enum NodeToAdd { Waypoint, Target }; [SerializeField] private NodeToAdd m_NodeToAdd = NodeToAdd.Waypoint; private Button button = null; private bool isPressed = false; private GameObject nodeInstance = null; private Camera mainCamera = null; private Vector3 pos = Vector3.zero; private Quaternion rot = Quaternion.identity; private Quaternion randomRotation = Quaternion.identity; private ARSpace arspace = null; void Start() { button = GetComponent