// ----------------------------------------------------------------------
        // Returns the visible port at graph position.
        iCS_EditorObject GetVisiblePortAt(Vector2 graphPosition)
        {
            var port = IStorage.GetPortAt(graphPosition);

            if (port != null && DisplayRoot.IsParentOf(port))
            {
                return(port);
            }
            return(null);
        }
        // ----------------------------------------------------------------------
        // Returns the visible node at graph position.
        iCS_EditorObject GetVisibleNodeAt(Vector2 graphPosition, iCS_EditorObject exclude = null)
        {
            var node = IStorage.GetNodeAt(graphPosition, exclude);

            // Anything outside the DisplayRoot will be mapped to the DisplayRoot.
            if (node != null && DisplayRoot.IsParentOf(node))
            {
                return(node);
            }
            return(DisplayRoot);
        }
Beispiel #3
0
        void Awake()
        {
            root            = new DisplayRoot(this);
            input           = new InputController(this);
            touchController = new TouchController(this);
            sceneBatch      = new DrawBatch();
            debugBatch      = new DrawBatch();

            if (shader == null)
            {
                shader = Shader.Find("Flunity/Default");
            }
        }
 protected CloudDriveBase(RootName rootName, CloudDriveParameters parameters)
 {
     _rootName   = rootName;
     DisplayRoot = rootName.Value;
     if (parameters != null)
     {
         _apiKey        = parameters.ApiKey;
         _encryptionKey = parameters.EncryptionKey;
     }
     if (string.IsNullOrEmpty(_encryptionKey))
     {
         DisplayRoot = DisplayRoot.Insert(0, "*");
     }
 }
        // ----------------------------------------------------------------------
        // Returns the closest visible port at graph position.
        iCS_EditorObject GetVisibleNodeWithEdgeAt(Vector2 graphPosition)
        {
            var node = IStorage.GetNodeWithEdgeAt(graphPosition);

            if (node != null)
            {
                if (DisplayRoot.IsParentOf(node))
                {
                    return(node);
                }
                if (node == DisplayRoot && IStorage.ShowDisplayRootNode == true)
                {
                    return(node);
                }
            }
            return(null);
        }
        // ----------------------------------------------------------------------
        public void TakeAnimationSnapshotForAll()
        {
            int len = EditorObjects.Count;

            myWasPresent = new bool[len];
            myWasVisible = new bool[len];
            for (int i = 0; i < EditorObjects.Count; ++i)
            {
                // Update presence & visible flags.
                var obj = EditorObjects[i];
                if (obj == null || !obj.IsValid)
                {
                    myWasPresent[i] = myWasVisible[i] = false;
                    continue;
                }
                myWasPresent[i] = true;
                myWasVisible[i] = IsVisibleInLayout(obj);
                // Get copy of the initial position.
                if (obj == DisplayRoot || DisplayRoot.IsParentOf(obj))
                {
                    obj.ResetAnimationRect(obj.GlobalRect);
                }
            }
        }