Commit 0be1f919 authored by Jérémy Lacoche's avatar Jérémy Lacoche
Browse files

Move files editor to package

parent af8bd09f
Loading
Loading
Loading
Loading

Assets/ETSI.ARF.meta

deleted100644 → 0
+0 −8
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: a1d6d8755812e254dbe089251c2bddc5
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData: 
  assetBundleName: 
  assetBundleVariant: 
+0 −8
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: e4474d3a0bcb9c44d9fd67da1ebb77c9
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData: 
  assetBundleName: 
  assetBundleVariant: 
+0 −8
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: 5fec767e3d1954e4e8af5dc2b3d4dd5d
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData: 
  assetBundleName: 
  assetBundleVariant: 
+0 −8
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: 452c5e5fd6387ad4984356aa2f11d245
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData: 
  assetBundleName: 
  assetBundleVariant: 
+0 −84
Original line number Diff line number Diff line
//
// ARF - Augmented Reality Framework (ETSI ISG ARF)
//
// Copyright 2024 ETSI
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Last change: July 2022
//

using UnityEditor;
using UnityEditor.Experimental.GraphView;
using UnityEngine;
using UnityEngine.UIElements;

using ETSI.ARF.WorldStorage.Editor.Windows;
using ETSI.ARF.OpenAPI.WorldStorage;

namespace ETSI.ARF.WorldStorage.Editor.Graph
{
    public class ARFEdgeLink : Edge
    {
        public WorldLink worldLink;
        public string GUID;

        public Image savedIcon;

        public ARFEdgeLink()
        {
            var doubleClickManipulator = new Clickable(Clicked);
            doubleClickManipulator.activators.Clear();
            doubleClickManipulator.activators.Add(new ManipulatorActivationFilter { button = MouseButton.LeftMouse, clickCount = 2 });
            this.AddManipulator(doubleClickManipulator);
        }
        public void Clicked()
        {
            Debug.Log(worldLink.ToJson());
            GraphEditorWindow.ShowWindow(this);
        }
        public void MarkUnsaved()
        {
            if (savedIcon == null)
            {
                //the icon to add if the node does not correspond to an element in the server
                Texture2D warningImage = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/cloud.png", typeof(Texture2D));
                savedIcon = new Image
                {
                    image = warningImage
                };
                savedIcon.style.width = 18;
                savedIcon.style.height = 18;
                savedIcon.style.minWidth = 18;
                savedIcon.style.minHeight = 18;
                savedIcon.style.flexGrow = 1;
                savedIcon.style.alignSelf = Align.Center;

            }
            if (!edgeControl.Contains(savedIcon))
            {
                edgeControl.Add(savedIcon);
            }
            tooltip = "This element is not synchronized with the World Storage";
        }

        public void MarkSaved()
        {
            if (edgeControl.Contains(savedIcon))
            {
                edgeControl.Remove(savedIcon);
                tooltip = "";
            }
        }
    }
}
 No newline at end of file
Loading