Exemplo n.º 1
0
 public void Init()
 {
     m_bulletShooter   = EBulletShooter.NONE;
     m_bulletType      = EBulletType.NONE;
     m_moveLen         = 0;
     m_targetCharacter = null;
 }
Exemplo n.º 2
0
 public void Init(Vector3 startPos, Vector3 moveVec, float bSpd, float range, EBulletType type, EBulletShooter shooter)
 {
     transform.position = startPos;
     m_moveVec          = moveVec;
     m_bulletSpd        = bSpd;
     m_bulletShooter    = shooter;
     m_bulletRange      = range;
     m_bulletType       = type;
     m_moveLen          = 0;
 }
Exemplo n.º 3
0
        public static AssetInfo GetBulletAssetInfo(EBulletType type)
        {
            switch (type)
            {
            case EBulletType.Light:
                return(new AssetInfo("common/bullet", "dandao01"));

            default:
                return(new AssetInfo("common/bullet", "bolt"));
            }
        }
Exemplo n.º 4
0
    public void Init(Vector3 startPos, Vector3 moveVec, float bSpd, float range, EBulletType type, Transform target, EBulletShooter shooter)
    {
        //유도 or 곡사
        m_targetCharacter = target;

        transform.position = startPos;
        m_moveVec          = moveVec;
        m_bulletSpd        = bSpd;
        m_bulletRange      = range;
        m_bulletShooter    = shooter;
        m_bulletType       = type;
        m_moveLen          = 0;
    }
Exemplo n.º 5
0
 public Bullet(ContentManager getContent, EBulletType getBulletType, string getTexture, int getWidth, int getHeight, int getRows, int getColumns)
 {
     Content    = getContent;
     SpriteAnim = new AnimSprite(Content, getTexture, getWidth, getHeight, getRows, getColumns);
     if (getBulletType == EBulletType.Player)
     {
         ShootAnim     = new AnimSprite(Content, "graphics/ShootEffect1SS", getWidth * 2, getHeight, 2, 1);
         ExplosionAnim = new AnimSprite(Content, "graphics/BulletExplosionSS", getWidth, getHeight, 1, 8);
     }
     else if (getBulletType == EBulletType.Enemy)
     {
         ShootAnim     = new AnimSprite(Content, "graphics/ShootEffect2SS", getWidth * 6, getHeight * 2, 2, 1);
         ExplosionAnim = new AnimSprite(Content, "graphics/BulletExplosion4SS", getWidth * 2, getHeight * 2, 1, 8);
     }
 }
Exemplo n.º 6
0
    //敵弾生成
    public void EBulletGenerate(
        Vector2 inEnemyPos
        , int inEnemyLevel
        , EBulletType inEBulletType)
    {
        //敵の位置(inEnemyPos)を基に、敵弾の発射位置を設定
        Vector2 eBulletVector2 = new Vector2(inEnemyPos.x + E_BULLET_POS_SET, inEnemyPos.y);

        //敵弾を生成し、発射
        switch (inEBulletType)
        {
        case EBulletType.straight:
            //直進弾
            this.EBulletStraight(eBulletVector2, inEnemyLevel);
            break;

        case EBulletType.homing:
            //ホーミング弾
            this.EBulletHoming(eBulletVector2, inEnemyLevel);
            break;
        }
    }
Exemplo n.º 7
0
    public void Init(Vector3 startPos, Vector3 moveVec, float bSpd, float range, EBulletType type, Vector3 target, EBulletShooter shooter)
    {
        //곡사용
        transform.position = startPos;
        m_moveVec          = moveVec;
        m_bulletSpd        = bSpd;
        m_bulletRange      = range; //곡사일경우 Length비례 Range(총 보간 time)이 정해짐
        m_bulletShooter    = shooter;
        m_bulletType       = type;
        m_moveLen          = 0;

        if (type == EBulletType.CURVE)   //시작지점 조정 추가필요
        {
            Vector3 center = (target + transform.position) / 2f;

            m_moveVec = (target - transform.position);

            m_bulletRange = m_moveVec.magnitude;


            Quaternion rotZAxis  = Quaternion.Euler(0, 0, Random.Range(-80f, 80f));
            Quaternion rotToward = Quaternion.LookRotation(m_moveVec.normalized);


            if (m_curvePoints.Count > 0) //전에 사용된 control point가 있을 경우
            {
                m_curvePoints[0].Set(0f, 0f, -0.5f);
                m_curvePoints[1].Set(0f, 0f, -0.5f);
                m_curvePoints[2].Set(0f, 0f, -0.5f);

                m_curvePoints[3].Set(0f, 0.65f, -0.3f);
                m_curvePoints[4].Set(0f, 0.1f, 0.4f);

                m_curvePoints[5].Set(0f, 0f, 0.5f);
                m_curvePoints[6].Set(0f, 0f, 0.5f);
                m_curvePoints[7].Set(0f, 0f, 0.5f);
            }
            else //없을 경우
            {
                m_curvePoints.Add(new Vector3(0f, 0f, -0.5f));
                m_curvePoints.Add(new Vector3(0f, 0f, -0.5f));
                m_curvePoints.Add(new Vector3(0f, 0f, -0.5f));

                m_curvePoints.Add(new Vector3(0f, 0.25f, -0.3f));
                m_curvePoints.Add(new Vector3(0f, 0.1f, 0.35f));

                m_curvePoints.Add(new Vector3(0f, 0f, 0.5f));
                m_curvePoints.Add(new Vector3(0f, 0f, 0.5f));
                m_curvePoints.Add(new Vector3(0f, 0f, 0.5f));
            }

            for (int i = 0; i < m_curvePoints.Count; i++)
            {
                m_curvePoints[i] *= m_bulletRange;                //scale
                m_curvePoints[i]  = rotZAxis * m_curvePoints[i];  //rotate
                m_curvePoints[i]  = rotToward * m_curvePoints[i]; //rotate
                m_curvePoints[i] += center;                       //translate
            }

            m_curveSegment = 0;
        }
    }
Exemplo n.º 8
0
 public void SetBT(EBulletType type)
 {
     m_bulletType = type;
 }