void Start()
    {
        xp = XP.FindObjectOfType <XP> ();

        selectorEnemy1 = SelectEnemyScript.FindObjectOfType <SelectEnemyScript> ();
        selectorEnemy2 = SelectEnemy2Script.FindObjectOfType <SelectEnemy2Script> ();

        animator = statusTextPanel.GetComponent <Animator> ();

        music = Music.FindObjectOfType <Music> ();

        //TURN THIS OFF WHEN BUILDING
        //music.BattleClip ();

        enemyFlee  = false;
        playerFlee = false;

        attackPoints = PlayerPrefs.GetInt("PLAYER_AP");

        playerController = PlayerAttackScriptMultipleEnemies.FindObjectOfType <PlayerAttackScriptMultipleEnemies>();

        xp.UpdateDisplay();

        playerTurn = true;
    }
コード例 #2
0
    void Start()
    {
        aimingReticle.SetActive(false);


        selected.SetActive(false);

        enemy2 = SelectEnemy2Script.FindObjectOfType <SelectEnemy2Script> ();
    }
コード例 #3
0
    public void OnMouseOver()
    {
        if (enemy2 == null)
        {
            enemy2 = SelectEnemy2Script.FindObjectOfType <SelectEnemy2Script> ();
        }


        if (Input.GetMouseButtonDown(0) && !enemy1Selected)
        {
            enemy1Selected = true;

            selected.SetActive(true);

            aimingReticleOther.SetActive(false);

            aimingReticle.SetActive(true);
            enemy2.selected2.SetActive(false);
            SelectEnemy2Script.enemy2Selected = false;

            Debug.Log("CLIIICKKKED");
        }
    }
    void Update()
    {
        if (selectorEnemy1 == null)
        {
            selectorEnemy1 = SelectEnemyScript.FindObjectOfType <SelectEnemyScript> ();
        }

        if (selectorEnemy2 == null)
        {
            selectorEnemy2 = SelectEnemy2Script.FindObjectOfType <SelectEnemy2Script> ();
        }

        Debug.Log("Player evade is " + playerController.evadeOn);

        if (playerTurn && !playerFlee && !enemyTurn1 && !enemyTurn2 && !doneFighting)
        {
            playerController.playerAnimator.SetBool("Evade", false);


            StartPlayerTurn();
        }

        if (!playerTurn && enemyTurn1 && !enemyTurn2 && !doneFighting)
        {
            selectorEnemy1.selected.SetActive(false);
            selectorEnemy2.selected2.SetActive(false);
            SelectEnemyScript.enemy1Selected  = false;
            SelectEnemy2Script.enemy2Selected = false;

            aimingReticle.SetActive(false);
            aimingReticle2.SetActive(false);


            if (pirate1.thisAiDead)
            {
                playerController.playerAnimator.SetBool("Evade", false);


                EndTurn();
            }

            StartEnemy1Turn();
        }

        if (!playerTurn && !enemyTurn1 && enemyTurn2 && !doneFighting)
        {
            aimingReticle.SetActive(false);
            aimingReticle2.SetActive(false);

            selectorEnemy1.selected.SetActive(false);
            selectorEnemy2.selected2.SetActive(false);
            SelectEnemyScript.enemy1Selected  = false;
            SelectEnemy2Script.enemy2Selected = false;

            if (pirate2.thisAiDead)
            {
                playerController.playerAnimator.SetBool("Evade", false);


                EndTurn();
            }

            StartEnemy2Turn();
        }

        if (doneFighting)
        {
        }
    }