Пример #1
0
 public void SetLayoutBasedOnBehavior(BehaviorBase behavior)
 {
     behavior.ClearUI(gameObject);
     behavior.UpdateUI(gameObject, false);
     gameObject.SetActive(true);
     gameObject.name = behavior.Name;
     if (Globals.InputMode == InputMode.Buttons)
     {
         GetComponent<ButtonEnabled>().ContentEnabled = false;
     }
     else
     {
         GetComponent<ButtonEnabled>().ContentEnabled = true;
     }
 }
    public void SetPreview(string name)
    {
        var behavior = _behaviors.GetBehavior(name);
        if (behavior == null)
        {
            return;
        }

        if (_preview != null)
        {
            ClearPreview();
        }

        _preview = behavior;

        if (_preview is Action && SelectedAction != null)
        {
            _covering = SelectedAction;
            _covering.ClearUI();
        }

        if (_preview is Trigger && SelectedTrigger != null)
        {
            _covering = SelectedTrigger;
            _covering.ClearUI();
        }

        if (_preview != null)
        {
            _preview.UpdateUI(true);
        }
    }