Пример #1
0
    void Awake()
    {
        if (myContainerDisplay == null)
        {
            myContainerDisplay = gameObject.GetComponentInChildren <ContainerDisplay>();
        }

        if (myContainerDisplay == null)
        {
            myContainerDisplay = gameObject.GetComponent <ContainerDisplay>();
        }

        startPos = this.transform.localPosition;
        UpdatePos();


        if (myContainerDisplay != null)
        {
            if (myContainerDisplay.IsWindowActive())
            {
                this.transform.localPosition = inPos;
            }
            else
            {
                this.transform.localPosition = outPos;
            }
        }

        if (tween == null)
        {
            tween         = this.GetComponent <TweenPosition>();
            tween.enabled = false;
        }
    }
Пример #2
0
    void Update()
    {
        if (!isDisabaled && Input.GetKeyDown(binding))
        {
            switch (actiontype)
            {
            case ActionType.toggle:

                containerDisplay.SetWindowIsActive(!containerDisplay.IsWindowActive());

                break;

            case ActionType.open:
                containerDisplay.SetWindowIsActive(true);
                break;

            case ActionType.close:
                containerDisplay.SetWindowIsActive(false);
                break;

            default:
                break;
            }
        }
    }