private void KeepFire() { if (_Target == null) { return; } if (_BurstCount <= 0 && _FireColdDownCounter.Completed) { _FireColdDownCounter.Recount(); _BurstCount = BurstTime; } if (_BurstCount > 0 && _FireIntervalCounter.Completed) { _FireIntervalCounter.Recount(); _BurstCount--; if (_BurstCount <= 0) { _FireColdDownCounter.Recount(); } _AudioController.PlayAudio(FireAudioIndex); _RangedWeaponLauncher?.FireOnce(FirePos[_FirePosCount].position, FirePos[_FirePosCount].forward); _MuzzleFires[_FirePosCount].Show(); _GunFireSmokes[_FirePosCount].Play(); _FirePosCount = (_FirePosCount + 1) % FirePos.Length; } }
private void StartTimeCount() { _GameStartTimeCount = GameStartTimeCount; _Counting = true; _SecondCounter.Recount(); GameStartAlertPanel.Ins.SetHeadTitle(TextSys.GetText(GameStartCountProcessingTextKey)); GameStartAlertPanel.Ins.SetTimeCount(_GameStartTimeCount.ToString()); }
private void Update() { if (_UpdateCounter.Completed) { _UpdateCounter.Recount(); GlobalResource.Ins.Power.Add(PowerPerSec * UpdateTime); } }
public void Init(GameObject avoid, Vector3 pos, Vector3 dir, float speed) { _Avoid = avoid; Trans.position = pos; Trans.rotation = Quaternion.LookRotation(dir); _Rb.velocity = dir.normalized * speed; _LifeTimeCounter.Recount(); }
public void Launch(Vector3 pos, Quaternion rot, Vector3 force, ItemGroup group) { _DropCounter.Recount(); Trans.position = pos; Trans.rotation = rot; ItemGroup = group; _Rb.AddForce(force, ForceMode.Impulse); }
public float NextFactor() { var result = Tools.Lerp(SpreadValue.Min, SpreadValue.Max, OverHeatFactor); OverHeatFactor = (OverHeatFactor + OverHeatIntensity).Clamp01(); _StayCounter.Recount(); return(result * (_SpreadNoise.Next() - 0.5f) / 2); }
private void FixedUpdate() { if (_RespawnCounter.Interpolant * (1 / _DifficultyFactor()) >= 1) { _RespawnCounter.Recount(); var character = GameObjectPool.Get <BaseCharacter>(PrefabPath); character.Trans.position = Trans.position; } }
private void FixedUpdate() { if (_ProduceCounter.Completed) { int remaining = _Package.PutItem(Product).Remaining.FirstOrDefault().Count; Debug.Log(_Package.GetItemStr()); if (remaining != 0) { _Dropper.Drop(new ItemGroup(Product.Id, remaining)); Debug.Log("drop"); } _ProduceCounter.Recount(); } }
public override TaskStatus OnUpdate() { if (_CountEnd) { _Counter.Recount(); _CountEnd = false; } if (!_Counter.Completed) { return(TaskStatus.Running); } _CountEnd = true; return(TaskStatus.Success); }
private void PlayerBasedLaunch() { if (PlayerTrans == null) { return; } if (!_LaunchCounter.Completed) { return; } _LaunchCounter.Recount(); var force = GetNextForceDir(PlayerTrans.rotation * Vector3.forward); _Launcher.position = Trans.position + force.normalized; _Launcher.rotation = Quaternion.LookRotation(force); var saucer = GameObjectPool.Get <FlyingSaucer>("flyingSaucer"); saucer.transform.position = _Launcher.position; saucer.Launch(force); }
public void GetHit(Vector3 hitPos, Vector3 hitDir, float damage) { if (!_ReRequestSimpleCounter.Completed || _Started) { return; } _Requested = !_Requested; _Mat.SetColor("_Light", _Requested ? RequestedColor : _BaseColor); PublicEvents.GameRequest?.Invoke(GameType, _Requested); _ReRequestSimpleCounter.Recount(); //LogPanel.Ins.LogSystem(_Requested // ? TextSys.RequestGameSuccess //: TextSys.CancelGameRequest); }
public void Interactive(ControlInfo info) { if (!info.Stay) { _TakeAmmoCounter.Recount(); _Used = false; } if (!_TakeAmmoCounter.Completed || _Used) { return; } var ammoId = Player.WeaponBelt.CurrentWeapon.AmmoGroup.AmmoId; Player.Package.PutItem((ammoId, ItemSys.GetInfo(ammoId).MaxStackNum)); _Used = true; }
public TaskStatus MeleeHit() { //if (_FireCounter.Completed) //{ // _FireCounter.Recount(); // var forward = Trans.forward.ProjectToXz(); // foreach (var raycastHit in Physics.SphereCastAll(Trans.position, MeleeSectorRadius, Vector3.one)) // { // if (raycastHit.transform == Trans) continue; // var pos = raycastHit.transform.position; // if (Mathf.Abs((pos - Trans.position).y) > MeleeSectorHeight) // continue; // if (Vector3.Angle(forward, pos - Trans.position) > MeleeSectorAngle / 2) // continue; // raycastHit.transform.gameObject.GetComponent<IHitAble>()?.GetHit( // pos, // (pos - Trans.position).normalized, // MeleeDamage); // } //} var target = GetTarget(); if (target == null || !_FireCounter.Completed) { return(TaskStatus.Failure); } _FireCounter.Recount(); target.GetHit( target.Trans.position, (target.Trans.position - Trans.position).normalized, MeleeDamage); _Animator.SetTrigger("Hit"); return(TaskStatus.Success); }
public void Show() { gameObject.SetActive(true); _LifeTimeCounter.Recount(); _SpriteRenderer.sprite = Textures.RandomTake(); }