コード例 #1
0
    public void EditOrReviewStepDetail(StepDetail detailAction)
    {
        if (detailPanel != null)
        {
            Destroy(detailPanel);
        }

        detailPanel = (GameObject)Instantiate(stepDetailPanel);

        detailPanel.transform.SetParent(selectionPanel.transform);
        //detailPanel.transform.position = new Vector3(0, 0, 0);
        detailPanel.GetComponent <RectTransform>().offsetMin = new Vector2(0, 0); //left bottom
        detailPanel.GetComponent <RectTransform>().offsetMax = new Vector2(0, 0); //right top
        detailPanel.transform.localScale = new Vector3(1f, 1f, 1f);

        detailPanel.name = "StepDetailPanel";
        stepDetailPAnel panelscript = detailPanel.GetComponent <stepDetailPAnel>();

        panelscript.Setup(this);
        panelscript.detailIntro.text = detailAction.stepDetailInfo;

        panelscript.scrollView.GetComponent <DetailStepScrollview>().storeData = storedData;

        createOperatorOnMap();

        storedData.isUpdated = true;
    }
コード例 #2
0
    public void AddSteps()
    {
        if (detailPanel != null)
        {
            Destroy(detailPanel);
        }

        detailPanel     = (GameObject)Instantiate(stepDetailPanel);
        IndetailActions = true;
        detailPanel.transform.SetParent(selectionPanel.transform);
        //detailPanel.transform.position = new Vector3(0,0,0);
        detailPanel.GetComponent <RectTransform>().offsetMin = new Vector2(0, 0); //left bottom
        detailPanel.GetComponent <RectTransform>().offsetMax = new Vector2(0, 0); //right top
        detailPanel.transform.localScale = new Vector3(1f, 1f, 1f);
        detailPanel.name = "StepDetailPanel";
        stepDetailPAnel panelscript = detailPanel.GetComponent <stepDetailPAnel>();

        panelscript.Setup(this);
        StepDetail newDetail = new StepDetail();

        storedData.newStrategy.steps.Add(newDetail);
        storedData.chosenStepIndex = storedData.newStrategy.steps.Count - 1;
        newDetail.stepIndex        = storedData.newStrategy.steps.Count - 1;
        cancelDetailBtn.SetActive(true);
        //Debug.Log(panel.transform.position);
    }