示例#1
0
    protected override void Update()
    {
        base.Update();

        if (!isDetectWall || background.HasEnvironment || Wall_Ratio.GetRatio.position == Initialposition)
        {
            if (GetComponent <LineRenderer>() != null &&
                GetComponent <LineRenderer>().enabled)
            {
                GetComponent <LineRenderer>().enabled = false;
            }

            if (!isDetectWall)
            {
                GameManager.instance.ui.DetecteWall.text  = "Scan the wall";
                GameManager.instance.ui.DetecteWall.color = Color.red;
            }
            else if (Wall_Ratio.GetRatio.position == Initialposition)
            {
                GameManager.instance.ui.DetecteWall.text  = "Tap On Screen";
                GameManager.instance.ui.DetecteWall.color = Color.green;
            }

            return;
        }


        List <Vector3> worldarea = background.GetWorldArea(Wall_Ratio.GetRatio, Wall_Ratio.GetRatio.position);

        background.DrawWorldArea(worldarea);
        CaptureArea = background.GetScreenArea(FPScam, worldarea[0], worldarea[2]);


        string Captureinfo = "";
        Color  front_color = new Color();

        isValidArea = background.isValidAre(CaptureArea, ref Captureinfo, ref front_color);


        GameManager.instance.ui.DetecteWall.color        = front_color;
        GameManager.instance.ui.DetecteWall.text         = Captureinfo;
        GameManager.instance.ui.SpawnButton.interactable = isValidArea;



#if UNITY_EDITOR
        if (!isValidArea)
        {
            return;
        }


        if (Input.GetKeyDown(KeyCode.Space))
        {
            Capture();
        }
#endif
    }