当前位置: 首页>>代码示例>>C#>>正文


C# HitInfo类代码示例

本文整理汇总了C#中HitInfo的典型用法代码示例。如果您正苦于以下问题:C# HitInfo类的具体用法?C# HitInfo怎么用?C# HitInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HitInfo类属于命名空间,在下文中一共展示了HitInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildingPartDestroyedEvent

 public BuildingPartDestroyedEvent(BuildingBlock buildingBlock, HitInfo info)
 {
     BuildingPart = new BuildingPart(buildingBlock);
     Info = info;
     string bonename = StringPool.Get(info.HitBone);
     HitBone = bonename == "" ? "unknown" : bonename;
 }
开发者ID:Notulp,项目名称:Pluton.Rust,代码行数:7,代码来源:BuildingPartDestroyedEvent.cs

示例2: EventManager

 private EventManager()
 {
     this.initializedFlag = false;
     this.initializedListener = null;
     this.hitInfoListener = null;
     this.lastHitInfo = null;
 }
开发者ID:uxvibe,项目名称:Unity-Pong,代码行数:7,代码来源:EventManager.cs

示例3: PrimaryFire

	protected override void PrimaryFire()
	{

		for (int i = 0; i < pelletCount; i++) //for each pellet, shoot one in a random direction based off the cone
		{

			RaycastHit hit;

			//Bullet recoil stuff and it's direction
			Quaternion fireRot = Quaternion.LookRotation(transform.forward);
			Quaternion randomRot = Random.rotation;
			float currentSpread = bulletSpreadCurve.Evaluate(fireTime / timeTillMaxSpreadAngle) * maxBulletSpreadAngle; //changes bulllet angle
			fireRot = Quaternion.RotateTowards(fireRot, randomRot, Random.Range(0.0f, currentSpread)); //randomises it within said cone


			if (Physics.Raycast(transform.position, fireRot * Vector3.forward, out hit, Mathf.Infinity))
			{
				HitInfo hitInfo = new HitInfo(); //send hitInfo stuff
				hitInfo.damage = damage;
				hitInfo.raycastHit = hit;
				hit.collider.gameObject.SendMessage("GunHitInfo", hitInfo, SendMessageOptions.DontRequireReceiver); //send damage and position of hit

			}
		}
		
	}
开发者ID:Foodpunch,项目名称:ZOMBIETOWNVR,代码行数:26,代码来源:ShotgunScript.cs

示例4: Kill

	private void Kill()
	{
		HitInfo hitInfo = new HitInfo(Entity, Entity, Vector3.zero, Vector3.zero, "Untagged");
		DamageInfo damageInfo = new DamageInfo(hitInfo, health.CurrentHealth);

		GlobalEvents.Invoke(new WeaponDamageEvent(null, damageInfo));
	}
开发者ID:Snakybo-School,项目名称:OUTGEFOUND,代码行数:7,代码来源:EntityDeath.cs

示例5: RecieveHit

    /// <summary>
    /// Recieve an attackValue.
    /// </summary>
    /// <param name="sender">Who sent the attackValue.</param>
    /// <param name="hitInfo">Attack info associated with the attackValue.</param>
    public virtual void RecieveHit(List<object> senders, int hitID, HitInfo hitInfo)
    {
        if (hitID == lastHitID) return;

        if (invincible) return;

        lastHitID = hitID;

        int damage = hitInfo.damage;

        // status effect
        if (hitInfo.effect != HitInfo.Effects.None)
        {
            damage = Mathf.CeilToInt(damage * statusEffectivenesses[(int)hitInfo.effect]);
            if (damage > 0)
            {
                Log(hitInfo.effect + ":" + (int)hitInfo.effect, Debugger.LogTypes.Combat);
                StopAllCoroutines();
                StartCoroutine(statusMethods[(int)hitInfo.effect], damage);
            }
        }

        ChangeHealth(-damage);
        CreateIndicator(damage);

        //if (HitEvent != null)
        //{
        //    HitEvent(senders, new HitEventArgs(hitInfo, currentHealth, damage));
        //}
        if (HitEvent != null)
        {
            HitEvent(senders, new HitEventArgs(hitInfo, currentHealth, damage));
        }
    }
开发者ID:syeager,项目名称:Knighthood,代码行数:39,代码来源:Health.cs

示例6: DelayedHitCalc

 public override RealHitInfo DelayedHitCalc(Line by, HitInfo hit)
 {
     RealHitInfo realHit = new RealHitInfo();
     realHit.HitStuff = Surface;
     realHit.Pigment = Pigment;
     realHit.Normal = new Line();
     realHit.Normal.Start = by.Project(hit.HitDist);
     realHit.Normal.Direct.Dx = 0;
     realHit.Normal.Direct.Dy = 0;
     realHit.Normal.Direct.Dz = 0;
     switch (hit.SurfaceIndex)
     {
         case 0:
             Point hitLoc2 = inv.Apply(realHit.Normal.Start);
             realHit.Normal.Direct.Dx = hitLoc2.X;
             realHit.Normal.Direct.Dy = hitLoc2.Y;
             realHit.Normal.Direct.Dz = hitLoc2.Z;
             break;
         default:
             throw new InvalidOperationException("Invalid surface index in hitdata");
     }
     Vector before = realHit.Normal.Direct;
     realHit.Normal.Direct = trans.Apply(realHit.Normal.Direct);
     if (realHit.Normal.Direct.Dot(by.Direct) > 0)
     {
         realHit.Normal.Direct.ScaleSelf(-1.0);
     }
     return realHit;
 }
开发者ID:Tilps,项目名称:Stash,代码行数:29,代码来源:Sphere.cs

示例7: killedPlayer

	public void killedPlayer(HitInfo hit)
	{
		totalKills++; // increment total kills
		if (hit.player.nickname != null)
			playerKills [hit.player.nickname]++; // increment player kills - use nickname
		translateKillToScore (hit.pokemon.level); // transalte kill to score
	}
开发者ID:heed13,项目名称:PokemonBattleArena,代码行数:7,代码来源:PlayerScore.cs

示例8: Kill

 public override void Kill()
 {
     var info = new HitInfo();
     info.damageTypes.Add(Rust.DamageType.Suicide, 100f);
     info.Initiator = baseNPC as BaseEntity;
     baseNPC.Die(info);
 }
开发者ID:Notulp,项目名称:Pluton,代码行数:7,代码来源:NPC.cs

示例9: OnFire

	public override void OnFire(HitInfo hit)
	{
		bool canFire = true;

		if(interval)
		{
			if(Time.time - lastGunshotTime < gunshotInterval)
			{
				canFire = false;
			}
			else
			{
				lastGunshotTime = Time.time;
			}
		}

		if(canFire)
		{		
			AudioChannel audioChannel = audioManager.PlayAt(gunshot, ((Firearm)Weapon).Position);
			if(audioChannel != null)
			{
				audioChannel.Pitch = Random.Range(gunshotPitchRange.x, gunshotPitchRange.y);
				SetSpatialBlend(audioChannel);
			}
		}
	}
开发者ID:Snakybo-School,项目名称:OUTGEFOUND,代码行数:26,代码来源:FirearmAudio.cs

示例10: Damage

	private void Damage(float damage)
	{
		HitInfo hitInfo = new HitInfo(Entity, Entity, Vector3.zero, Vector3.zero, "Untagged");
		DamageInfo damageInfo = new DamageInfo(hitInfo, damage);

		GlobalEvents.Invoke(new WeaponDamageEvent(null, damageInfo));
	}
开发者ID:Snakybo-School,项目名称:OUTGEFOUND,代码行数:7,代码来源:EntityHealth.cs

示例11: HammerEvent

 public HammerEvent(HitInfo info, BasePlayer player)
 {
     _info = info;
     basePlayer = player;
     string bonename = StringPool.Get(info.HitBone);
     HitBone = bonename == "" ? "unknown" : bonename;
 }
开发者ID:Notulp,项目名称:Pluton,代码行数:7,代码来源:HammerEvent.cs

示例12: PlayHitAnimation

	public override void PlayHitAnimation(int totalHealth, HitInfo hitInfo) {
		if (_animator.GetCurrentAnimatorStateInfo(0).IsName(_animationClipName[EUnitAnimationState.Skill_ClipDischarge]) ||
			_animator.GetCurrentAnimatorStateInfo(0).IsName(_animationClipName[EUnitAnimationState.Skill_StunGrenade])) {
				return;
		}

		base.PlayHitAnimation(totalHealth, hitInfo);
	}
开发者ID:UpdateShu,项目名称:ForceFury_Unity5,代码行数:8,代码来源:HeroCapralModelView.cs

示例13: OnFire

	public override void OnFire(HitInfo hit)
	{
		Remaining--;

		if(Remaining <= 0)
		{
			Weapon.Wielder.Events.Invoke(new MagazineEmptyEvent());
			Weapon.StopFire(true);
		}
	}
开发者ID:Snakybo-School,项目名称:OUTGEFOUND,代码行数:10,代码来源:Magazine.cs

示例14: CombatEntityHurtEvent

        public CombatEntityHurtEvent(BaseCombatEntity combatEnt, HitInfo info)
            : base(info)
        {
            var block = combatEnt.GetComponent<BuildingBlock>();

            if (block != null)
                Victim = new BuildingPart(block);
            else
                Victim = new Entity(combatEnt);
        }
开发者ID:Notulp,项目名称:Pluton,代码行数:10,代码来源:CombatEntityHurtEvent.cs

示例15: Check

        public bool Check()
        {
            var hit = LocalCache.TryGet<object>(this.CacheKey) as HitInfo;

            if (hit != null)
            {
                return hit.Counter++ < this.Limit;
            }

            hit = new HitInfo { Counter = 1 };
            Dependency.Resolve<ILocalCache>().Add(this.CacheKey, hit, this.Duration);
            return true;
        }
开发者ID:VictorTomaili,项目名称:Sanity,代码行数:13,代码来源:Throttler.cs


注:本文中的HitInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。