コード例 #1
0
    private void ProcessRaycast()
    {
        RaycastHit hit;

        if (Physics.Raycast(FPSCamera.transform.position, FPSCamera.transform.forward, out hit, weaponRange))
        {
            Headshot headshot = hit.transform.GetComponent <Headshot>();
            Enemy    enemy    = hit.transform.GetComponentInParent <Enemy>();
            if (headshot)
            {
                int headShotMultiplier = headshot.GetHeadshotMultiplier();
                if (playerUIHandler != null)
                {
                    playerUIHandler.AddToScore(enemy.GetValue() * headShotMultiplier);
                }
                ProcessEnemyHit(enemy, hit, weaponDamage * headShotMultiplier);
            }
            else if (enemy)
            {
                ProcessEnemyHit(enemy, hit, weaponDamage);
                if (playerUIHandler != null)
                {
                    playerUIHandler.AddToScore(enemy.GetValue());
                }
            }
            else
            {
                PlayDefaultHitEffect(hit.point);
            }
        }
    }
コード例 #2
0
 public Player()
 {
     Name              = new PlayerName();
     ByeWeeks          = new ByeWeeks();
     Headshot          = new Headshot();
     EligiblePositions = new List <EligiblePosition>();
 }
コード例 #3
0
        public void Apply(Hero hero, EntitiesManager manager)
        {
            var headshot    = new Headshot();
            var verbalAbuse = manager.SkillManager.Find("Verbal Abuse");

            hero.UnlearnSkill(verbalAbuse);
            hero.LearnSkillEvenly(headshot, 2);
            manager.SkillManager.Stored.Add(headshot);
        }
コード例 #4
0
ファイル: BulletNeworked.cs プロジェクト: blaj95/RiotArena
    protected virtual void OnPlayerHeadshot(Collision hitPlayer)
    {
        GameObject hit      = hitPlayer.gameObject;
        PhotonView hitView  = hit.GetPhotonView();
        Headshot   headShot = hit.GetComponent <Headshot>();

        //print("Player hit!");
        //// Only deal damage on shooter client
        if (PhotonNetwork.isMasterClient)
        {
            headShot.OnHeadshot(_damage * 2);
        }
        Destroy(gameObject);
    }