Exemple #1
0
        private void addPanel_openButton_Click(string title)
        {
            try {
                string            path = HKOpenFileDialog.selectFile(HKDialogFilter.Library);
                AttandanceLibrary lib  = FileSerilizeOpener <AttandanceLibrary> .open(path);

                GlobalStation.shareInstance.librarys.isCustomize      = true;
                GlobalStation.shareInstance.librarys.customizeLibrary = CustomLibrary.createLibrary(lib, path);
                LibraryHallPanel hall = new LibraryHallPanel();
                hall.libraryUUID = lib.UUID;
                GlobalStation.shareInstance.entrance.showPanel(hall);
            }catch (HKOpenFileDialog.CancelOpenFileException) { }
        }
    // Returns true if this trigger is pulled, returns false otherwise
    bool IsPulled()
    {
        if (CustomLibrary.NoInputIsDetected())
        {
            return(false);
        }

        RaycastHit2D objectAtPosition;

        Vector2[] inputPositions = CustomLibrary.GetInputPositions();

        foreach (Vector2 position in inputPositions)
        {
            objectAtPosition = Physics2D.Raycast(position, Vector2.zero);

            if (objectAtPosition.collider != null && objectAtPosition.collider.gameObject.GetInstanceID() == this.gameObject.GetInstanceID())
            {
                return(true);
            }
        }

        return(false);
    }