コード例 #1
0
ファイル: GameLogic.cs プロジェクト: Afor1zm/Unforgotten
    public UIHealthBarPlayer Seed_fieldsForUIEnemy(GameObject enemyUIObject, EnemyUnit_Reaper enemyUnit)
    {
        UIHealthBarPlayer createdUI = enemyUIObject.GetComponentInChildren <UIHealthBarPlayer>();

        enemyUnit._enemyUI = enemyUIObject;
        createdUI._unit    = enemyUnit;
        return(createdUI);
    }
コード例 #2
0
ファイル: GameLogic.cs プロジェクト: Afor1zm/Unforgotten
    public EnemyUnit_Reaper Seed_fieldsForEnemy(GameObject enemyGameObject, GameObject copiedPlayerObject, PlayerUnit copiedUnit)
    {
        EnemyUnit_Reaper createdUnit = enemyGameObject.GetComponent <EnemyUnit_Reaper>();

        createdUnit._playerUnit   = copiedUnit;
        createdUnit._playerObject = copiedPlayerObject;
        return(createdUnit);
    }
コード例 #3
0
ファイル: EnemySpawner.cs プロジェクト: Afor1zm/Unforgotten
 // Update is called once per frame
 void Update()
 {
     _elapsedTime += Time.deltaTime;
     if (_elapsedTime > _secondsBetweenSpawn)
     {
         _elapsedTime = 0;
         // Spawning Enemies
         _enemyObject = _gameLogic.SpawnFunction(_enemyObjectPrefab, new Vector3(startPosition.x, startPosition.y, 0f));
         _enemyUnit   = _gameLogic.Seed_fieldsForEnemy(_enemyObject, _playerObject, _playerUnit);
         //if (_enemyUnit.transform.position.x > 0)
         //{
         //    _presenter.FlipSpriteLeft(_enemyUnit);
         //}
         // Spawning Enemies's UI
         _enemyUIObject = _gameLogic.SpawnFunction(_enemyUIPrefab, new Vector3(startPosition.x, startPosition.y, 0f));
         _uIHealth      = _gameLogic.Seed_fieldsForUIEnemy(_enemyUIObject, _enemyUnit);
     }
 }