GUIControl.drawMonkeys C# (CSharp) Méthode

drawMonkeys() public méthode

public drawMonkeys ( ) : void
Résultat void
    void drawMonkeys()
    {
        int m = 0;
        foreach( CMonkey monkey in allMonkeys){

            int posX = box1x + boxXDistance * m;
            int posY = (int) getYposition(m);
            //Debug.Log("Macaco " + m + " Tipo " + monkey.monkeyClass);
            GUI.Label (new Rect (posX + 79, posY+7 , 	BarraVaziaTexture.width,BarraVaziaTexture.height), BarraVaziaTexture);
            GUI.Label (AddRect(new Rect (posX, 		posY,		BoxMacacoTexture.width,BoxMacacoTexture.height)), BoxMacacoTexture);

            if(monkey.monkeyClass == CMonkey.eMonkeyType.Astronaut){
                GUI.Label (new Rect (posX + 70 , posY + 40, AstronautaNomeTexture.width,AstronautaNomeTexture.height), AstronautaNomeTexture);
                if (monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_CAPTURED)
                    GUI.Label (new Rect (posX +15,  posY +11,	AstronautaMonkeyTexturePreso.width,AstronautaMonkeyTexturePreso.height), AstronautaMonkeyTexturePreso);
                else
                    GUI.Label (new Rect (posX +15,  posY +11,	AstronautaMonkeyTexture.width,AstronautaMonkeyTexture.height), AstronautaMonkeyTexture);

                if (monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_IDLE){
                    GUI.Label (new Rect (posX + 18 , posY + 71, AtaqueTextureOFF.width,AtaqueTextureOFF.height), AtaqueTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , getYposition(m)  + 71, MoverTextureON.width,MoverTextureOFF.height), MoverTextureOFF);
                    //desceSlot(m);
                }else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_WALKING){
                    GUI.Label (new Rect (posX + 18 , posY + 71, AtaqueTextureOFF.width,AtaqueTextureOFF.height), AtaqueTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureON.height), MoverTextureON);
                    //sobeSlot(m);
                }else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_ATTACKING || monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_PURSUIT){
                    GUI.Label (new Rect (posX + 18 , posY + 71, AtaqueTextureON.width,AtaqueTextureON.height), AtaqueTextureON);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureOFF.height), MoverTextureOFF);
                    //sobeSlot(m);
                } else {
                    GUI.Label (new Rect (posX + 18, getYposition(m) + 71, AtaqueTextureOFF.width,AtaqueTextureOFF.height), AtaqueTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY + 71, MoverTextureON.width,MoverTextureOFF.height), MoverTextureOFF);
                    //desceSlot(m);
                }
            } else 	if(monkey.monkeyClass == CMonkey.eMonkeyType.Engineer){
                GUI.Label (new Rect (posX + 70 , posY + 40, EngenheiroNomeTexture.width,EngenheiroNomeTexture.height), EngenheiroNomeTexture);
                if (monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_CAPTURED)
                    GUI.Label (new Rect (posX +15,  posY +11,	EngenheiroMonkeyTexturePreso.width,EngenheiroMonkeyTexturePreso.height), EngenheiroMonkeyTexturePreso);
                else
                    GUI.Label (new Rect (posX +15,  posY +11,	EngenheiroMonkeyTexture.width,EngenheiroMonkeyTexture.height), EngenheiroMonkeyTexture);
                if (monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_IDLE){
                    GUI.Label (new Rect (posX + 18 , posY + 71, ReciclarTextureON.width,ReciclarTextureON.height), ReciclarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureOFF.height), MoverTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, RepararTextureON.width,RepararTextureON.height), RepararTextureOFF);
                }else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_WALKING){
                    GUI.Label (new Rect (posX + 18 , posY + 71, ReciclarTextureON.width,ReciclarTextureON.height), ReciclarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY + 71, MoverTextureON.width,MoverTextureON.height), MoverTextureON);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, RepararTextureON.width,RepararTextureON.height), RepararTextureOFF);
                }else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_WORKING){
                    GUI.Label (new Rect (posX + 18 , posY + 71, ReciclarTextureON.width,ReciclarTextureON.height), ReciclarTextureON);
                    GUI.Label (new Rect (posX + 18 + 45 , posY + 71, MoverTextureON.width,MoverTextureOFF.height), MoverTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, RepararTextureOFF.width,RepararTextureOFF.height), RepararTextureOFF);
                }else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_ATTACKING){
                    GUI.Label (new Rect (posX + 18, posY + 71, ReciclarTextureOFF.width,ReciclarTextureOFF.height), ReciclarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY + 71, MoverTextureOFF.width,MoverTextureOFF.height), MoverTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, RepararTextureON.width,RepararTextureON.height), RepararTextureON);
                } else
                {
                    GUI.Label (new Rect (posX + 18 , posY + 71, ReciclarTextureON.width,ReciclarTextureON.height), ReciclarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureOFF.height), MoverTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, RepararTextureON.width,RepararTextureON.height), RepararTextureOFF);
                }
            } else 	if(monkey.monkeyClass == CMonkey.eMonkeyType.Cientist){
                GUI.Label (new Rect (posX + 70 , posY + 40, CientistaNomeTexture.width,CientistaNomeTexture.height), CientistaNomeTexture);
                if (monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_CAPTURED)
                    GUI.Label (new Rect (posX +15,  posY +11,	CientistaMonkeyTexturePreso.width,CientistaMonkeyTexturePreso.height), CientistaMonkeyTexturePreso);
                else
                    GUI.Label (new Rect (posX +15,  posY +11,	CientistaMonkeyTexture.width,CientistaMonkeyTexture.height), CientistaMonkeyTexture);
                if (monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_IDLE){
                    GUI.Label (new Rect (posX + 18 , posY + 71, ProcurarTextureOFF.width,ProcurarTextureOFF.height), ProcurarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureOFF.height), MoverTextureOFF);
                }else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_WALKING){
                    GUI.Label (new Rect (posX + 18 , posY + 71, ProcurarTextureOFF.width,ProcurarTextureOFF.height), ProcurarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY + 71, MoverTextureON.width,MoverTextureON.height), MoverTextureON);
                }else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_WORKING){
                    GUI.Label (new Rect (posX + 18 , posY + 71, ProcurarTextureON.width,ProcurarTextureON.height), ProcurarTextureON);
                    GUI.Label (new Rect (posX + 18 + 45 , posY + 71, MoverTextureOFF.width,MoverTextureOFF.height), MoverTextureOFF);
                } else
                {
                    GUI.Label (new Rect (posX + 18 , posY + 71, ProcurarTextureON.width,ProcurarTextureON.height), ProcurarTextureON);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureOFF.height), MoverTextureOFF);
                }
            } else 	if(monkey.monkeyClass == CMonkey.eMonkeyType.Saboteur){
                GUI.Label (new Rect (posX + 70 , posY + 40, SabotadorNomeTexture.width,SabotadorNomeTexture.height), SabotadorNomeTexture);
                if (monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_CAPTURED)
                    GUI.Label (new Rect (posX +15,  posY +11,	SabotadorMonkeyTexturePreso.width,SabotadorMonkeyTexturePreso.height), SabotadorMonkeyTexturePreso);
                else
                    GUI.Label (new Rect (posX +15,  posY +11,	SabotadorMonkeyTexture.width,SabotadorMonkeyTexture.height), SabotadorMonkeyTexture);
                if (monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_IDLE){
                    GUI.Label (new Rect (posX + 18 , posY + 71, SabotarTextureOFF.width,SabotarTextureOFF.height), SabotarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureOFF.height), MoverTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, ReprogramarTextureOFF.width,ReprogramarTextureOFF.height), ReprogramarTextureOFF);
                }else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_WALKING){
                    GUI.Label (new Rect (posX + 18 , posY + 71, SabotarTextureOFF.width,SabotarTextureOFF.height), SabotarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureON.height), MoverTextureON);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, ReprogramarTextureOFF.width,ReprogramarTextureOFF.height), ReprogramarTextureOFF);
                }else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_WORKING && monkey.workingMouseState == MouseWorldPosition.eMouseStates.TargetingForReprogram){
                    GUI.Label (new Rect (posX + 18 , posY + 71, SabotarTextureOFF.width,SabotarTextureOFF.height), SabotarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureOFF.width,MoverTextureOFF.height), MoverTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, ReprogramarTextureON.width,ReprogramarTextureON.height), ReprogramarTextureON);
                } else if(monkey.getFSMCurrentState() == CMonkey.FSMState.STATE_WORKING && ( monkey.workingMouseState == MouseWorldPosition.eMouseStates.CanSabotageBuilding || monkey.workingMouseState == MouseWorldPosition.eMouseStates.CanSabotageDrone)){
                    GUI.Label (new Rect (posX + 18 , posY + 71, SabotarTextureON.width,SabotarTextureON.height), SabotarTextureON);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureON.height), MoverTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, ReprogramarTextureOFF.width,ReprogramarTextureOFF.height), ReprogramarTextureOFF);
                } else
                {
                    GUI.Label (new Rect (posX + 18 , posY + 71, SabotarTextureON.width,SabotarTextureON.height), SabotarTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 , posY  + 71, MoverTextureON.width,MoverTextureON.height), MoverTextureOFF);
                    GUI.Label (new Rect (posX + 18 + 45 + 45, posY + 71, ReprogramarTextureOFF.width,ReprogramarTextureOFF.height), ReprogramarTextureOFF);
                }
            }
            m++;
        }
    }