Exemplo n.º 1
0
    //発射
    public override GameObject Fire(InputStatus input)
    {
        index++;
        UseMp();
        Transform tran = muzzles.Count > 0 ? muzzles[0] : myTran;

        return(Spawn(spawn, input.GetPoint(), Quaternion.identity, input.GetTapEnemyTran()));
    }
Exemplo n.º 2
0
    //目標ポイント取得
    protected virtual Vector2 GetTarget(InputStatus input)
    {
        Vector2 target = input.GetPoint();

        if (isDrag)
        {
            Vector2 direction = input.GetStartPoint() - input.GetEndPoint();
            target = direction + Common.FUNC.ParseVector2(myTran.position);
        }
        return(target);
    }
Exemplo n.º 3
0
    IEnumerator ContinuousSpawn(InputStatus input)
    {
        float preTime     = 0;
        float sumDistance = 0;

        for (; ;)
        {
            if (preTime >= input.pressTime)
            {
                break;
            }
            Vector2 pos    = input.GetPoint();
            Vector2 prePos = input.GetPrePoint();
            sumDistance += (pos - prePos).magnitude;
            if (sumDistance >= perLength)
            {
                sumDistance = 0;
                if (totalLimit > 0)
                {
                    objList.RemoveAll(o => o == null);
                }
                GameObject obj = Spawn(spawn, pos, Quaternion.identity);
                if (obj != null)
                {
                    UseMp();
                    if (isPlayerForward || isLineAngle)
                    {
                        Vector3 target = Vector3.zero;
                        if (isPlayerForward)
                        {
                            target = obj.transform.position + (obj.transform.position - player.transform.position);
                        }
                        else if (isLineAngle)
                        {
                            target = pos + pos - prePos;
                        }
                        Common.FUNC.LookAt(obj.transform, target);
                    }
                    if (totalLimit > 0)
                    {
                        objList.Add(obj);
                        if (objList.Count > totalLimit)
                        {
                            Destroy(objList[0]);
                        }
                    }
                }
            }
            preTime = input.pressTime;
            yield return(null);
        }
        fireCoroutine = null;
    }