Ejemplo n.º 1
0
        void ISignalListener <SpawnUnitSignal> .SignalFired(SpawnUnitSignal signal)
        {
            ClientOnlyConditionalDebug.Log("spawn");
            var viewInstance = Object.Instantiate(signal.View, signal.Position, Quaternion.identity);
            var unit         = new Entities.Unit(signal.Data, viewInstance);

            _signalService.FireSignal(new UnitSpawnedSignal(unit));
        }
Ejemplo n.º 2
0
        private int GetCalculatedDamage(int damage, Vector3 damagePosition, Vector3 targetPosition)
        {
            RaycastHit hit;

            UnityEngine.Debug.DrawLine(damagePosition, targetPosition);
            if (!Physics.Linecast(damagePosition, targetPosition, out hit) || hit.transform.GetComponent <ObstacleView>() == null)
            {
                return(damage);
            }
            ClientOnlyConditionalDebug.Log("obstacle found");
            return((int)(damage * _settings.ObstacleFactor));
        }
Ejemplo n.º 3
0
        private void Awake()
        {
            ClientOnlyConditionalDebug.Log("game started");
            Assert.IsNotNull(_unitGenerationSettingsProvider);
            Assert.IsNotNull(_bombGenerationSettingsProvider);
            Assert.IsNotNull(_damageSettingsProvider);

            _currentContext = new GameContext(
                _unitGenerationSettingsProvider.Settings,
                _bombGenerationSettingsProvider.Settings,
                _damageSettingsProvider.Settings);
            _currentContext.Init();
            ClientOnlyConditionalDebug.Log("context created");
        }
Ejemplo n.º 4
0
 public UnitDamageService(ISignalService signalService, DamageSettings settings)
 {
     _signalService = signalService;
     _settings      = settings;
     ClientOnlyConditionalDebug.Log("hello I am damage service");
 }
Ejemplo n.º 5
0
 public BombGenerationService(ISignalService signalService, BombGenerationSettings settings)
 {
     _signalService = signalService;
     _settings      = settings;
     ClientOnlyConditionalDebug.Log("hello I am unit generation service");
 }