예제 #1
0
        private void frmAvisoPregunta_Load(object sender, EventArgs e)
        {
            if (tipo == "modal")
            {
                this.BackColor          = Color.Black;
                this.ventanaModal.Owner = this;
                this.ventanaModal.Show();
                return;
            }


            if (tipo == "")
            {
                p          = new yesno(this, this.mensaje);
                p.enviando = recibiendo;
                p.Show();
            }
            else if (tipo == "informacion")
            {
                informacion          = new frmInformacion(this, this.mensaje, this.titulo);
                informacion.enviando = recibiendo;
                informacion.Show();
            }
            else if (tipo == "error")
            {
                error          = new frmError(this.mensaje, this.titulo, this);
                error.enviando = recibiendo;
                error.Show();
            }
            else if (tipo == "exclamation")
            {
                exclamation          = new frmExclamacion(this.mensaje, this.titulo, this);
                exclamation.enviando = recibiendo;
                exclamation.Show();
            }
            else if (tipo == "question")
            {
                question          = new frmQuestion(this.mensaje, this.titulo, this);
                question.enviando = recibiendo;
                question.Show();
            }
            else
            {
                success          = new frmSuccess(this.mensaje, this.titulo, this);
                success.enviando = recibiendo;
                success.Show();
            }
        }
예제 #2
0
파일: v1_2.cs 프로젝트: Civa/Zenith
 public Min()
 {
     this.inclusiveField = yesno.yes;
 }
예제 #3
0
 public void noClick()
 {
     YesNo = yesno.no;
 }
예제 #4
0
    // Update is called once per frame
    void Update()
    {
        if (initialize == false)
        {
            gameManager = GetComponent <GameManager>();
            drag        = GetComponent <DragAndDrop>();

            HideQuestion();
            YesNo = yesno.notSelected;
            //CalledFunction = calledFunction.none;
            yesButton.onClick.AddListener(yesClick);
            noButton.onClick.AddListener(noClick);
            resetStats();
            _redRevive[0]  = reviveRedMage;
            _redRevive[1]  = reviveRedArcher;
            _redRevive[2]  = reviveRedTank;
            _redRevive[3]  = reviveRedPawn;
            _redRevive[4]  = reviveRedKnight;
            _blueRevive[0] = reviveBlueMage;
            _blueRevive[1] = reviveBlueArcher;
            _blueRevive[2] = reviveBlueTank;
            _blueRevive[3] = reviveBluePawn;
            _blueRevive[4] = reviveBlueKnight;

            initialize = true;
        }

        if (reviveUI == true)
        {
            if (Input.GetMouseButtonDown(1))
            {
                Debug.Log("hi");
                gameManager.AwaitingResponse = false;
                gameManager.CheckCount++;
                StartCoroutine(gameManager.PerformChecks());
                YesNo = yesno.notSelected;
                HideDeadTroops();
            }
        }
        if (gameManager.turn == Turn.Red)
        {
            redLabel.SetActive(true);
            blueLabel.SetActive(false);

            if (gameManager.state == State.TroopPlacement && drag.troopScript != null)
            {
                stats.text = (drag.troopScript.Health + "\n" + drag.troopScript.attackDamage + "\n" + drag.troopScript.attackDist + "\n" + drag.troopScript.moveDist);

                if (drag.troopScript.gameObject.tag == "King")
                {
                    currentTroop.GetComponent <Image>().sprite = redKing;
                }
                else if (drag.troopScript.gameObject.tag == "Pawn")
                {
                    currentTroop.GetComponent <Image>().sprite = redPawn;
                }
                else if (drag.troopScript.gameObject.tag == "Knight")
                {
                    currentTroop.GetComponent <Image>().sprite = redKnight;
                }
                else if (drag.troopScript.gameObject.tag == "Archer")
                {
                    currentTroop.GetComponent <Image>().sprite = redArcher;
                }
                else if (drag.troopScript.gameObject.tag == "Mage")
                {
                    currentTroop.GetComponent <Image>().sprite = redMage;
                }
                else if (drag.troopScript.gameObject.tag == "Tank")
                {
                    currentTroop.GetComponent <Image>().sprite = redTank;
                }
                else if (drag.troopScript.gameObject.tag == "Priest")
                {
                    currentTroop.GetComponent <Image>().sprite = redPriest;
                }
            }

            else if (gameManager.state == State.Gameplay && gameManager.troopScript != null)
            {
                stats.text = (gameManager.troopScript.Health + "\n" + gameManager.troopScript.attackDamage + "\n" + gameManager.troopScript.attackDist + "\n" + gameManager.troopScript.moveDist);

                if (gameManager.troopScript.gameObject.tag == "King")
                {
                    currentTroop.GetComponent <Image>().sprite = redKing;
                }
                else if (gameManager.troopScript.gameObject.tag == "Pawn")
                {
                    currentTroop.GetComponent <Image>().sprite = redPawn;
                }
                else if (gameManager.troopScript.gameObject.tag == "Knight")
                {
                    currentTroop.GetComponent <Image>().sprite = redKnight;
                }
                else if (gameManager.troopScript.gameObject.tag == "Archer")
                {
                    currentTroop.GetComponent <Image>().sprite = redArcher;
                }
                else if (gameManager.troopScript.gameObject.tag == "Mage")
                {
                    currentTroop.GetComponent <Image>().sprite = redMage;
                }
                else if (gameManager.troopScript.gameObject.tag == "Tank")
                {
                    currentTroop.GetComponent <Image>().sprite = redTank;
                }
                else if (gameManager.troopScript.gameObject.tag == "Priest")
                {
                    currentTroop.GetComponent <Image>().sprite = redPriest;
                }
            }
        }
        else if (gameManager.turn == Turn.Blue)
        {
            redLabel.SetActive(false);
            blueLabel.SetActive(true);

            if (gameManager.state == State.TroopPlacement && gameManager.phase != Phase.Checks && drag.troopScript != null)
            {
                stats.text = (drag.troopScript.Health + "\n" + drag.troopScript.attackDamage + "\n" + drag.troopScript.attackDist + "\n" + drag.troopScript.moveDist);

                if (drag.troopScript.gameObject.tag == "King")
                {
                    currentTroop.GetComponent <Image>().sprite = blueKing;
                }
                else if (drag.troopScript.gameObject.tag == "Pawn")
                {
                    currentTroop.GetComponent <Image>().sprite = bluePawn;
                }
                else if (drag.troopScript.gameObject.tag == "Knight")
                {
                    currentTroop.GetComponent <Image>().sprite = blueKnight;
                }
                else if (drag.troopScript.gameObject.tag == "Archer")
                {
                    currentTroop.GetComponent <Image>().sprite = blueArcher;
                }
                else if (drag.troopScript.gameObject.tag == "Mage")
                {
                    currentTroop.GetComponent <Image>().sprite = blueMage;
                }
                else if (drag.troopScript.gameObject.tag == "Tank")
                {
                    currentTroop.GetComponent <Image>().sprite = blueTank;
                }
                else if (drag.troopScript.gameObject.tag == "Priest")
                {
                    currentTroop.GetComponent <Image>().sprite = bluePriest;
                }
            }

            else if (gameManager.state == State.Gameplay && gameManager.phase != Phase.Checks && gameManager.troopScript != null)
            {
                stats.text = (gameManager.troopScript.Health + "\n" + gameManager.troopScript.attackDamage + "\n" + gameManager.troopScript.attackDist + "\n" + gameManager.troopScript.moveDist);

                if (gameManager.troopScript.gameObject.tag == "King")
                {
                    currentTroop.GetComponent <Image>().sprite = blueKing;
                }
                else if (gameManager.troopScript.gameObject.tag == "Pawn")
                {
                    currentTroop.GetComponent <Image>().sprite = bluePawn;
                }
                else if (gameManager.troopScript.gameObject.tag == "Knight")
                {
                    currentTroop.GetComponent <Image>().sprite = blueKnight;
                }
                else if (gameManager.troopScript.gameObject.tag == "Archer")
                {
                    currentTroop.GetComponent <Image>().sprite = blueArcher;
                }
                else if (gameManager.troopScript.gameObject.tag == "Mage")
                {
                    currentTroop.GetComponent <Image>().sprite = blueMage;
                }
                else if (gameManager.troopScript.gameObject.tag == "Tank")
                {
                    currentTroop.GetComponent <Image>().sprite = blueTank;
                }
                else if (gameManager.troopScript.gameObject.tag == "Priest")
                {
                    currentTroop.GetComponent <Image>().sprite = bluePriest;
                }
            }
        }

        if (gameManager.state == State.TroopPlacement || gameManager.phase == Phase.Checks)
        {
            phase.GetComponent <Image>().enabled = false;
            skipPhase.SetActive(false);
        }
        else if (gameManager.phase == Phase.Movement)
        {
            phase.GetComponent <Image>().enabled = true;
            phase.GetComponent <Image>().sprite  = movement;
            skipPhase.SetActive(true);
        }
        else if (gameManager.phase == Phase.Attack)
        {
            phase.GetComponent <Image>().enabled = true;
            phase.GetComponent <Image>().sprite  = attack;
            skipPhase.SetActive(true);
        }

        if (gameOver == true && YesNo == yesno.yes)
        {
            SceneManager.LoadScene(1);
        }
        else if (gameOver == true && YesNo == yesno.no)
        {
            SceneManager.LoadScene(0);
        }
    }
예제 #5
0
 public void yesClick()
 {
     YesNo = yesno.yes;
 }