コード例 #1
0
 // Use this for initialization
 void Start()
 {
     endTurnPanel               = this;
     totalAmount                = 1;
     BATTLEMETER_FULL_HEIGHT    = battlemeterBackground.rectTransform.sizeDelta.y;
     BATTLEMETER_FULL_WIDTH     = battlemeterBackground.rectTransform.sizeDelta.x;
     BATTLEMETER_CONTENT_HEIGHT = battlemeterPlayerWon.rectTransform.sizeDelta.y;
     MARKER_WIDTH               = marker.rectTransform.sizeDelta.x;
     BUFFER_HEIGHT              = buffer.rectTransform.sizeDelta.y;
     endTurnButton.GetComponent <Button>().onClick.AddListener(
         delegate { BattleCentralControl.endTurnPrep();
                    BattleCentralControl.playerTurn = false;
                    BattleCentralControl.startTurnPrep();
                    updateBattlemeter(); });
     leaveButton.GetComponent <Button>().onClick.AddListener(
         delegate {
         updateBattlemeter();
         BattleResultDisplay.instance.loadBattleResult(BattleCentralControl.enemyParty.partyMember, BattleCentralControl.deadEnemy, BattleCentralControl.deadPlayer,
                                                       BattleCentralControl.enemyParty.cash, BattleCentralControl.playerParty.expToDistribute);
     });
     slower.onClick.AddListener(delegate { Time.timeScale -= .2f; Time.timeScale = Mathf.Clamp(Time.timeScale, .4f, 1.0f); });
     faster.onClick.AddListener(delegate { Time.timeScale += .2f; Time.timeScale = Mathf.Clamp(Time.timeScale, 1.6f, 1.0f); });
     normal.onClick.AddListener(delegate { Time.timeScale = 1.0f; });
     battleResult = BattleResult.enemyWon;
     gameObject.SetActive(false);
 }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        instance = this;
        showed   = false;
        close.onClick.AddListener(delegate() {
            showBattleResult = false;
            gameObject.SetActive(false);
            BattleCentralControl.endBattle();
        });
        BAR_HEIGHT = totalEnemyBar.rectTransform.sizeDelta.y;
        BAR_WIDTH  = totalEnemyBar.rectTransform.sizeDelta.x;
        if (deadEnemy == null)
        {
            deadEnemy = new List <Person>();
        }
        if (totalEnemy == null)
        {
            totalEnemy = new List <Person>();
        }

        if (deadPlayer == null)
        {
            deadPlayer = new List <Person>();
        }
    }