本文整理汇总了C#中Bullet类的典型用法代码示例。如果您正苦于以下问题:C# Bullet类的具体用法?C# Bullet怎么用?C# Bullet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Bullet类属于命名空间,在下文中一共展示了Bullet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShootWeapon
private void ShootWeapon(Vector2 PlayerCenter)
{
Bullet newBullet = new Bullet();
newBullet.Shoot(PlayerCenter, new Vector2(Mouse.GetState().X, Mouse.GetState().Y) - Camera._position);
_Shoot.Play();
Bullets.Add(newBullet);
}
示例2: HealOnHit
protected void HealOnHit(HittableObject target, Bullet bullet, RaycastHit rch, ref bool pierce)
{
Enemy e = target as Enemy;
if (e == null) return;
e.Heal(amt);
}
示例3: ProcessHit
//struct FishAndOddsMulti
//{
// public FishAndOddsMulti(Fish f,int oddMulti)
// {
// F = f;
// OddMulti = oddMulti;
// }
// public Fish F;
// public int OddMulti;
//}
public static void ProcessHit(Bullet b , Fish f)
{
switch(f.HittableTypeS)
{
case "Normal":
Process_NormalFish(b,f);
break;
case "AreaBomb":
Process_AreaBomb(b,f);
break;
case "SameTypeBomb":
Process_FishTypeBomb2(b,f);
break;
case "FreezeBomb":
Process_FreezeBomb(b, f);
break;
case "SameTypeBombEx":
Process_FishTypeBombEx(b, f);
break;
default:
if (Evt_HitExtension != null)
Evt_HitExtension(b, f);
break;
}
}
示例4: CreateWeb
void CreateWeb(Bullet b, WebScoreScaleRatio webData,bool isLizi)
{
GameObject goWebBoom = Instantiate(webData.PrefabWebBoom) as GameObject;
goWebBoom.transform.parent = transform;
Ef_WebBubble efBubble = goWebBoom.GetComponent<Ef_WebBubble>();
if (efBubble != null)
{
efBubble.ScaleTarget = webData.BubbleScale;
}
Ef_WebBoom[] efWebs = goWebBoom.GetComponentsInChildren<Ef_WebBoom>();
foreach (Ef_WebBoom efWeb in efWebs)
{
efWeb.Prefab_GoSpriteWeb = webData.PrefabWeb;
efWeb.NameSprite = webData.NameSprite;
//Debug.Log(webData.NameSprite);
efWeb.ScaleTarget = webData.Scale;
efWeb.transform.localPosition *= webData.PositionScale;
if(!isLizi)
efWeb.ColorInitialize = Prefab_WebColorNormal.Colors[b.Owner.Idx % Prefab_WebColorNormal.Colors.Length];
}
Transform tsWeb = goWebBoom.transform;
Transform tsBullet = b.transform;
tsWeb.position = new Vector3(tsBullet.position.x, tsBullet.position.y, Defines.GlobleDepth_Web);
tsWeb.rotation = tsBullet.rotation;
}
示例5: onHit
private void onHit(Vector3 position, Bullet bullet)
{
bullet.OnHit -= onHit;
StartCoroutine(effectCoroutine(explosionsPull, bullet.transform.position, false));
bullet.Rigidbody.velocity = Vector3.zero;
bulletsPull.ReleaseObject(bullet);
}
示例6: attack
public void attack()
{
if (Engine.IsKeyDown(keyMap.attack) && Engine.Timer.Get("coolDown") <= 0)
{
bullet = new Bullet(direction);
if (direction == Bullet.bulletsDirection.RIGHT)
{
bullet.X = this.X + Sprite.Width;
bullet.Y = this.Y + Sprite.Height / 2;
}
if (direction == Bullet.bulletsDirection.LEFT)
{
bullet.X = this.X - bullet.Width;
bullet.Y = this.Y + Sprite.Height / 2;
}
if (direction == Bullet.bulletsDirection.UP)
{
bullet.X = this.X + Sprite.Width / 2 - (bullet.Width / 2);
bullet.Y = this.Y - bullet.Height;
}
if (direction == Bullet.bulletsDirection.DOWN)
{
bullet.X = this.X + Sprite.Width / 2 - (bullet.Width / 2);
bullet.Y = this.Y + Sprite.Height;
}
bulletsShot.Add(bullet);
Engine.SpawnObject("bullet", bullet);
bullet.isShoot = true;
Engine.Timer.Set("coolDown", 0.5f);
}
}
示例7: Gun
public Gun(GameplayScreen gameplayScreen, GameCharacter owner)
: base(gameplayScreen, owner)
{
_bullet = new Bullet(ImageManager.BulletTexture);
coolDownTime = 0.8;
coolDownElapsed = 0;
}
示例8: AddThreat
public void AddThreat(Bullet threat, Vector2 collisionPosition, float timeToCollision)
{
if (!AlreadyHasThisBullet(threat.transform))
{
threats.Add(new Threat(threat.transform, collisionPosition, timeToCollision));
}
}
示例9: Start
/// <summary>
/// Gets all necessary references.
/// </summary>
void Start()
{
photonView = this.GetComponent<PhotonView>();
myBullet = this.GetComponent<Bullet>();
isMine = photonView.isMine;
}
示例10: Awake
public static BulletManager instance; // 다른 곳에서 참조하지 못하도록 static 변수로 선언
void Awake()
{
instance = this;
bullet[0].skillBorder.enabled = true;
bullet[1].skillBorder.enabled = false;
selected = bullet[0];
}
示例11: drawBullet
public void drawBullet(Bullet theBullet)
{
gameCanvas.Children.Add(theBullet.getBulletShape());
TranslateTransform initialTransform = new TranslateTransform(theBullet.getBulletX(), theBullet.getBulletY());
theBullet.getBulletShape().RenderTransform = initialTransform;
}
示例12: InstantiateBullet
void InstantiateBullet(Bullet bullet, int angle)
{
var obj = Instantiate( bullet, transform.position, Quaternion.AngleAxis(angle - 90, Vector3.forward) ) as Bullet;
//Debug.Log ("Obj is " + obj );
obj.transform.parent = Manager.RootBullet.transform;
}
示例13: Start
new void Start()
{
base.Start();
m_bullet = CreateBullet(m_firingDescs[0], m_gunPoint.transform.position) as Bullet;
StartCoroutine(EffectShield());
}
示例14: Handle_BulletHit
void Handle_BulletHit(bool isMiss, Player p, Bullet b, Fish f)
{
if (!isMiss)
{
b.SelfDestroy();
}
}
示例15: OnCollisionEnter
void OnCollisionEnter(Collision collision) {
Debug.Log("Enemy was hit by Collision:" + collision.transform.name);
playerBullet = collision.gameObject.GetComponent<Bullet>();
if(playerBullet == null) {
playerWeapon = (Weapon)GameConstants.findPlayerInProject().GetComponent<ToonCharacter_Inventory>().getPlayerWeapon();
}
if (playerBullet != null) {
this.GetComponent<BaseEnemy>().health -= GameConstants.getPlayerAttackDamage();
Destroy(collision.gameObject);
} else if (playerWeapon != null) {
if (collision.transform.name.Equals(playerWeapon.transform.name)) {
//Make Enemy Damage from Melee
if (collision.transform.gameObject.GetComponent<Inventory>() is IWeapon) {
if (GameConstants.findPlayerInProject().GetComponent<ToonCharacter_DamageEnemyOneTime>().isAttacking) {
if (!GameConstants.findPlayerInProject().GetComponent<ToonCharacter_DamageEnemyOneTime>().oneHit) {
this.GetComponent<BaseEnemy>().health -= GameConstants.getPlayerAttackDamage();
}
//Set Only One Time Damage per Animation
GameConstants.findPlayerInProject().GetComponent<ToonCharacter_DamageEnemyOneTime>().oneHit = true;
}
}
}
}
}