Пример #1
0
 private void Moving()
 {
     SetSpeed();
     //落下したら
     if (wallHitter.IsHit(gameObject, HitPointFlag.Bottom))
     {
         FallOut();
     }
     if (wallHitter.IsHit(gameObject, HitPointFlag.Left | HitPointFlag.Right | HitPointFlag.Top))
     {
         se.Play();
     }
 }
Пример #2
0
 public void AllStart()
 {
     foreach (BaseEnemy it in Enemies)
     {
         if (wallHitter.IsHit(it.gameObject, HitPointFlag.GameIn))
         {
             it.Stop = BaseEnemy.StopStatus.None;
         }
         else
         {
             it.Stop = BaseEnemy.StopStatus.AttackStoped;
         }
     }
     foreach (EnemyBullet it in Bullets)
     {
         it.IsStoped = false;
     }
 }
Пример #3
0
    protected void FixedUpdate()
    {
        if (!IsStoped)
        {
            transform.Translate(new Vector2(0, Speed * Time.fixedDeltaTime));

            if (wallhitter.IsHit(gameObject, HitPointFlag.Bottom))
            {
                GameObject.Find("EnemyManager").GetComponent <EnemyManager>().Bullets.Remove(this);
                Destroy(gameObject);
            }
        }
    }
Пример #4
0
    private void FixedUpdate()
    {
        if (Items.Count == 0)
        {
            return;
        }
        foreach (ItemMover it in Items)
        {
            if (it == null || it.gameObject == null)
            {
                continue;
            }
            if (wallHItter.IsHit(it.gameObject, HitPointFlag.Bottom))
            {
                Destroy(it.gameObject);
            }
            else if (wallHItter.IsHit(it.gameObject, HitPointFlag.Left | HitPointFlag.Right))
            {
                it.SpeedReturn();
            }
        }

        Items.RemoveAll(a => a == null);
    }
Пример #5
0
 private void FixedUpdate()
 {
     if (wallhitter.IsHit(gameObject, HitPointFlag.Right | HitPointFlag.Left))
     {
         direction *= -1;
         if (BossImage.sprite == BossSprite[0])
         {
             BossImage.sprite = BossSprite[1];
         }
         else
         {
             BossImage.sprite = BossSprite[0];
         }
     }
     transform.Translate(speed * Time.fixedDeltaTime * direction, 0, 0);
 }