コード例 #1
0
        public async Task <int> Damage(GameDamage d)
        {
            SSQCDamage dd = new SSQCDamage
            {
                GameID         = d.GameID,
                GameTime       = d.GameTime,
                Attacker_TF_ID = d.Attacker.TF_ID,
                Target_TF_ID   = d.Target.TF_ID,
                WeaponType     = d.WeaponType,
                Damage         = d.Damage,
                Shot_ID        = d.Shot_ID,
                VHeight        = d.VHeight,
                DeathType      = d.DeathType,
                HadFlag        = d.HadFlag
            };

            await _context.AddAsync(dd);

            return(await _context.SaveChangesAsync());
        }
コード例 #2
0
 public async Task <int> Damage(GameDamage d)
 {
     // submit data
     return(await _SSQCStatsRepository.Damage(d));
 }
コード例 #3
0
        public async Task <int> Damage([FromBody] GameDamage d)
        {
            var resp = await _statsService.Damage(d);

            return(resp);
        }
コード例 #4
0
    private void Update()
    {
        if (Time.time >= (timeCount + LifeTime) - 0.5f)
        {
            if (gameDamageObject == null)
            {
                gameDamageObject = GetComponent <GameDamage>();
            }
            if (gameDamageObject != null)
            {
                gameDamageObject.Active();
            }
        }

        if (Target)
        {
            Quaternion rotation = Quaternion.LookRotation(Target.transform.position - transform.transform.position);
            transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * Damping);
            Vector3 dir       = (Target.transform.position - transform.position).normalized;
            float   direction = Vector3.Dot(dir, transform.forward);
            if (direction < TargetLockDirection)
            {
                Target = null;
            }
        }

        if (Seeker)
        {
            if (timetorock > DurationLock)
            {
                if (!locked && !Target)
                {
                    float distance = int.MaxValue;
                    for (int t = 0; t < TargetTag.Length; t++)
                    {
                        if (GameObject.FindGameObjectsWithTag(TargetTag[t]).Length > 0)
                        {
                            GameObject[] objs = GameObject.FindGameObjectsWithTag(TargetTag[t]);

                            for (int i = 0; i < objs.Length; i++)
                            {
                                if (objs[i])
                                {
                                    Vector3 dir       = (objs[i].transform.position - transform.position).normalized;
                                    float   direction = Vector3.Dot(dir, transform.forward);
                                    float   dis       = Vector3.Distance(objs[i].transform.position, transform.position);
                                    if (direction >= TargetLockDirection)
                                    {
                                        if (DistanceLock > dis)
                                        {
                                            if (distance > dis)
                                            {
                                                distance = dis;
                                                Target   = objs[i];
                                            }
                                            locked = true;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                timetorock += 1;
            }

            if (Target)
            {
            }
            else
            {
                locked = false;
            }
        }
    }