//public void Init(MenuMode mode, GameObject ContainerForSpawnedItems, string InstructionName = null)
    //{
    //    _mode = mode;
    //    _instructionManager = InstructionManager.Instance;
    //    this.ContainerForSpawnedItems = ContainerForSpawnedItems;

    //    if (_mode == MenuMode.Record || _mode == MenuMode.Edit)
    //    {
    //        if(_mode == MenuMode.Edit)
    //        {
    //            _instructionManager.LoadInstruction(InstructionName);
    //            LoadStep(_instructionManager.GetCurrentStep());
    //        }
    //        else
    //        {
    //            _instructionManager.CreateNewInstruction(InstructionName, DateTime.Now);
    //        }

    //        NextStepButton.SetActive(true);

    //        Keyboard.TextTyped.AddListener(NewText);
    //    }
    //    else
    //    {
    //        _instructionManager.LoadInstruction(InstructionName);

    //        InsertTextButton.SetActive(false);
    //        FinishButton.SetActive(false);

    //        LoadStep(_instructionManager.GetCurrentStep());
    //        if (!_instructionManager.NextStepAvailabe())
    //        {
    //            NextStepButton.SetActive(false);
    //        }
    //    }
    //    PreviousStepButton.SetActive(false);

    //}

    /// <summary>
    /// goes into the next step of the instruction or adds a new steps if current steps is the last one
    /// </summary>
    public void NextStep()
    {
        // is this alway necessary?
        _instructionManager.Save();

        ClearItems();

        if (!_instructionManager.NextStepAvailabe() && (_mode == MenuMode.Record /*||_mode == MenuMode.Edit*/))
        {
            _instructionManager.AddStep();

            PhotoVideoPanelController.Reset(_instructionManager.GetCurrentMediaFiles());
            InstructionText.text = "Description:";
        }
        else
        {
            _instructionManager.StepForward();
            LoadStep(_instructionManager.GetCurrentStep());

            if (!_instructionManager.NextStepAvailabe() && _mode == MenuMode.Replay)
            {
                NextStepButton.SetActive(false);
            }
        }

        // this should be alway true
        if (_instructionManager.PreviousStepAvailabe())
        {
            PreviousStepButton.SetActive(true);
        }

        SetStepCounterText();
    }
示例#2
0
    public void SetMode(MenuMode mode)
    {
        MarkerPanel.SetActive(false);
        PhotoPanel.SetActive(true);
        PhotoPanel.GetComponent <PhotoVideoPanelController>().SetMode(mode);

        MainPanel.SetActive(true);
        MainPanel.GetComponent <MainPanelController>().Init(mode, _containerForSpawnedItems);

        if (mode == MenuMode.Record) //|| _mode == MenuMode.Edit
        {
            ItemPanel.SetActive(true);
            ItemPanel.GetComponent <ItemPanelController>().ContainerForSpawnedItems = _containerForSpawnedItems;
            PhotoPanel.GetComponent <PhotoVideoPanelController>().Reset(_instructionManager.GetCurrentMediaFiles());
        }
        else
        {
            PhotoPanel.GetComponent <PhotoVideoPanelController>().Reset(_instructionManager.GetCurrentMediaFiles());
        }
    }