public PlayerController(ScriptableObjectCharacter player, IProjectileService projectileService, float health)
        {
            _scriptableObjectCharacter = player;
            _projectileService         = projectileService;
            GameObject playerObj = GameObject.Instantiate(player.playerView.gameObject);

            playerObj.transform.position = player.playerSpawnPosition;
            _playerView = playerObj.GetComponent <PlayerView>();
            health      = player.health;
            fixedPos    = playerObj.transform.position;
            _playerView.SetPlayerController(this);
            SetHealthBarFirst(health);
        }
        public NPCController(ScriptableObjectCharacter npc, IProjectileService projectileService, float health)
        {
            _scriptableObjectCharacter = npc;
            _projectileService         = projectileService;
            GameObject npcObject = GameObject.Instantiate(npc.npcView.gameObject);

            npcObject.transform.position = npc.npcSpawnPosition;
            _npcView = npcObject.GetComponent <NPCView>();
            health   = npc.health;
            _npcView.SetNpcController(this);
            SetHealthBarFirst(health);
            fixedPos = npcObject.transform.position;
        }
 public PlayerService(IProjectileService projectileService, ScriptableObjectCharacter scriptableObjectCharacter)
 {
     _characterObj      = scriptableObjectCharacter;
     _projectileService = projectileService;
     SpawnPlayer(_health);
 }
示例#4
0
 public NPCService(IProjectileService projectileService, ScriptableObjectCharacter scriptableObjectCharacter)
 {
     _projectileService = projectileService;
     _characterObj      = scriptableObjectCharacter;
     SpawnNpc(_health);
 }