private void Start()
    {
        uiController     = GetComponent <BattleUIControl>();
        battleController = uiController.GetComponent <BattleControl>();

        playerHPBarRect    = playerHPBar.GetComponent <RectTransform>();
        playerHPDamageRect = playerHPDamage.GetComponent <RectTransform>();
        enemyHPBarRect     = enemyHPBar.GetComponent <RectTransform>();
        enemyHPDamageRect  = enemyHPDamage.GetComponent <RectTransform>();

        hpSizeMax = playerHPBarRect.rect.width;
        hpSize    = hpSizeMax;
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        battleControl  = GetComponent <BattleControl>();
        cameraControl  = FindObjectOfType <BattleCameraControl>();
        uiController   = battleUI.GetComponent <BattleUIControl>();
        uiTextControl  = battleUI.GetComponent <BattleTextUIControl>();
        uiHPControl    = battleUI.GetComponent <BattleHPControl>();
        battleDialogue = battleUI.GetComponent <BattleDialogue>();
        uIEventHandler = FindObjectOfType <BattleUIEventHandler>();
        soundManager   = FindObjectOfType <SoundManager>();

        dataCont   = GameObject.Find("GameDataController");
        playerData = dataCont.GetComponent <PlayerDataHolder>();
    }
    void Start()
    {
        dataController  = GameObject.Find("GameDataController");
        soundManager    = FindObjectOfType <SoundManager>();
        mp              = dataController.GetComponent <Monpedia>();
        playerMon       = ScriptableObject.CreateInstance <MonBattleData>();
        enemyMon        = ScriptableObject.CreateInstance <MonBattleData>();
        stateControl    = GetComponent <BattleStateControl>();
        uiButtonControl = battleUIController.GetComponent <BattleUIControl>();
        uiHPControl     = battleUIController.GetComponent <BattleHPControl>();
        battleDialogue  = battleUIController.GetComponent <BattleDialogue>();
        fleeAttempts    = 0;

        soundManager.PlayMusic("Battle");
    }