public void RenderBox(string name)
    {
        boxRender = GameObject.FindObjectsOfType <BoxRender>()[0];
        Vector3 size = xmlReader.getSizeByName(name);

        size = size * 1;
        Debug.Log("Detektujem: " + name + ", sa Vektrom3: " + size);
        Vector3 vek = paletPosition[name];


        if (getMyLevel(name) == 2)
        {
            //proveri da li su sve na prvom nivou postavljene

            foreach (string boxAtLevel1 in boxesAtLevel1)
            {
                if (placedBoxes.Contains(boxAtLevel1) == false)
                {
                    UI_Main ui = GameObject.FindObjectOfType <UI_Main>();
                    ui.setUiStatusText("First finish level 1!");
                    ui.setUiStatusColor(UIStatus.Red);

                    //destroyCollider(ui.name);

                    return;
                }
            }
        }

        boxRender.RenderBox(name, paletPosition[name], size);
    }
Ejemplo n.º 2
0
    private void UI_Control(string name)
    {
        UI_Main ui = GameObject.FindObjectOfType <UI_Main>();

        ui.setUiStatusSprite(name);
        ui.setUiStatusText("Box is detected!");
        ui.setUiStatusButtonText("Place box");
    }
    //Function for geting next box that need to be placed at pallet
    public Box NextBox()    //prvo vrati sve sa prvog nivoa
    {
        if (boxPointer < this.scanBoxes.Count)
        {
            if (getMyLevel(this.scanBoxes[this.boxPointer].Name) == 2)
            {
                //proveri da li su sve na prvom nivou postavljene

                foreach (string boxAtLevel1 in boxesAtLevel1)
                {
                    Box myBox = boxesAtPallet.Find(el => el.Name.Equals(boxAtLevel1));
                    if (myBox == null)
                    {
                        UI_Main ui = GameObject.FindObjectOfType <UI_Main>();
                        ui.setUiStatusText("First finish level 1!");
                        ui.setUiStatusColor(UIStatus.Red);
                        this.scanBoxes.Add(myBox);
                        this.boxPointer++;
                        break;
                    }
                }
            }
            if (boxPointer < this.scanBoxes.Count)
            {
                RenderBox(this.scanBoxes[boxPointer].Name);

                radMode_BoxColider[] prefabList = GameObject.FindObjectsOfType <radMode_BoxColider>();
                foreach (var item in prefabList)
                {
                    if (item.name == this.scanBoxes[boxPointer].Name)
                    {
                        item.makeBlueBox(this.scanBoxes[boxPointer].Name);
                        break;
                    }
                }
                return(this.scanBoxes[boxPointer++]);
            }
        }
        return(null);
    }
Ejemplo n.º 4
0
 private void UI_Control(string name)
 {
     uiMain.setUiStatusSprite(name);
     uiMain.setUiStatusText("Box is detected!");
     uiMain.setUiStatusButtonText("Place box");
 }