Пример #1
0
    public void Init(ParameterMetadata parameterMetadata, string type, object value, VerticalLayoutGroup layoutGroupToBeDisabled, GameObject canvasRoot,
                     Parameter.OnChangeParameterHandlerDelegate onChangeParameterHandler, CanvasGroup windowToHideWhenRequestingObj, bool linkable = true)
    {
        base.Init(parameterMetadata, type, value, layoutGroupToBeDisabled, canvasRoot, onChangeParameterHandler, linkable);
        canvasGroupToHide = windowToHideWhenRequestingObj;
        List <string> options = new List <string>();

        /*foreach (Base.ActionPoint ap in Base.ProjectManager.Instance.GetAllActionPoints()) {
         *  foreach (IO.Swagger.Model.NamedOrientation orientation in ap.GetNamedOrientations()) {
         *      options.Add(ap.Data.Name + "." + orientation.Name);
         *  }
         * }*/
        if (value != null)
        {
            try {
                selectedAP          = ProjectManager.Instance.GetActionPointWithOrientation((string)value);
                selectedOrientation = selectedAP.GetOrientationVisual((string)value);
            } catch (KeyNotFoundException ex) {
                Debug.LogError(ex);
            }
        }
        if (type == "link")
        {
            ActionsDropdown.SetValue($"{selectedAP.GetName()}.{selectedOrientation.GetName()}");
        }

        UpdateButtonLabel();
    }