Exemplo n.º 1
0
    private IEnumerator Shoot_Cor()
    {
        ShootSystem _shoot    = GetComponent <ShootSystem>();
        Renderer    _renderer = GetComponent <Renderer>();

        if (_shoot == null)
        {
            yield break;
        }

        yield return(new WaitForSeconds(start_Time));

        if (loop_Count < 0)
        {
            loop_Count = 100;
        }
        for (int i = 0; i < loop_Count; i++)
        {
            if (_renderer == null)
            {
                _shoot.Shoot();
                UsualSoundManager.Instance.Play_Shoot_Sound();
            }
            else if (_renderer.isVisible)
            {
                _shoot.Shoot();
                UsualSoundManager.Instance.Play_Shoot_Sound();
            }
            yield return(new WaitForSeconds(span));
        }
    }
Exemplo n.º 2
0
    void Start()
    {
        _move  = GetComponent <MoveMotion>();
        _shoot = GetComponentInChildren <ShootSystem>();

        StartCoroutine("Action_Cor");
    }
    //バブルショット用
    private IEnumerator Bubble_Shoot_Cor()
    {
        if (player == null)
        {
            yield break;
        }

        int   num  = 15;
        float span = 0.1f;

        //ショットの向き
        int direction = (transform.position.x - player.transform.position.x).CompareTo(0);

        if (direction == 0)
        {
            direction = 1;
        }
        transform.localScale = new Vector3(direction, 1, 1);
        ShootSystem shoot = (direction > 0) ? bubble_Shoot_Left : bubble_Shoot_Right;

        yield return(new WaitForSeconds(1.0f));

        //ショット
        _anim.SetBool("OpenMouseBool", true);
        for (int i = 0; i < num; i++)
        {
            shoot.max_Speed = Random.Range(15f, 130f);
            shoot.Shoot();
            yield return(new WaitForSeconds(span - Time.deltaTime));
        }
        _anim.SetBool("OpenMouseBool", false);
    }
Exemplo n.º 4
0
    private IEnumerator Wing_Shoot_Cor()
    {
        //変数取得
        GameObject      player = GameObject.FindWithTag("PlayerTag");
        AngleCalculater AC     = new AngleCalculater();

        ShootSystem[,] shoots = new ShootSystem[5, 2];
        for (int i = 0; i < 5; i++)
        {
            shoots[i, 0] = wing_Shoot_Obj.transform.GetChild(i).GetComponents <ShootSystem>()[0];
            shoots[i, 1] = wing_Shoot_Obj.transform.GetChild(i).GetComponents <ShootSystem>()[1];
        }
        //ショット
        while (true)
        {
            float angle = AC.Cal_Angle_Two_Points(transform.position, player.transform.position);
            for (int i = 0; i < 5; i++)
            {
                shoots[i, 0].center_Angle_Deg = angle - 80;
                shoots[i, 1].center_Angle_Deg = angle + 80;
                shoots[i, 0].Shoot();
                shoots[i, 1].Shoot();
            }
            yield return(new WaitForSeconds(3.4f));
        }
    }
Exemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     _ShootSystem = ShootSystemFactory.Create(this);
     _InputSystem = new InputManager();
     _InputSystem.Player.ChooseDirection.performed += RotateGun;
     _InputSystem.Enable();
     cam = Camera.main;
 }
Exemplo n.º 6
0
 void Start()
 {
     ssystem      = GetComponent <ShootSystem>();
     velocity     = new Vector2(speedWalk, 0.0f);
     velocityFall = new Vector2(0, speedFall);
     animator     = transform.gameObject.GetComponent <Animator>();
     rigidbody2d  = transform.gameObject.GetComponent <Rigidbody2D>();
 }
Exemplo n.º 7
0
 void Start()
 {
     //取得
     player             = GameObject.FindWithTag("PlayerTag");
     main_Camera        = GameObject.FindWithTag("MainCamera");
     _rigid             = GetComponent <Rigidbody2D>();
     _gravitate         = GetComponent <GravitatePlayer>();
     _move              = GetComponent <MoveConstTime>();
     _shoot             = GetComponentInChildren <ShootSystem>();
     _gravitate.enabled = false;
 }
Exemplo n.º 8
0
    protected override void Start()
    {
        base.Start();

        switch (CurrUseMode)
        {
        case UseMode.Shoot:
            SS_script = GameObject.Find("ShootSystem").GetComponent <ShootSystem>();
            break;
        }

        selected_button = 0;
    }
Exemplo n.º 9
0
 void Start()
 {
     MyExtensionMethods.InitAudio(ref shootSound, StringNamesInfo.FIRE_SOUND);
     MyExtensionMethods.InitAudio(ref deniedSound, StringNamesInfo.DENIED_SOUND);
     if (!whatToControll)
     {
         return;
     }
     #region CACHE_COMPONENTS
     controllGun   = whatToControll.GetComponent <BuildGunScript>().ControllGunSystem;
     controllShoot = whatToControll.GetComponent <BuildGunScript>().ShootSystem;
     #endregion
     Slider rotateController = GameObject.Find(StringNamesInfo.ROTATEGUNCONTROLLER_name).GetComponent <Slider>();
     rotateController.value    = 90.0f;
     rotateController.minValue = controllGun.MinAngle;
     rotateController.maxValue = controllGun.MaxAngle;
     rotateController.onValueChanged.AddListener(delegate { controllGun.RotateGun(rotateController.value); });
     StartCoroutine(LateStart());
 }
Exemplo n.º 10
0
    void Awake()
    {
        baseSprite   = GunRendererScript.baseSprite[GunRendererScript.indexToSet];
        barrelSprite = GunRendererScript.barrelSprite[GunRendererScript.indexToSet];
        if (baseSprite)
        {
            transform.GetComponentInParent <SpriteRenderer>().sprite = baseSprite;
        }
        if (barrelSprite)
        {
            transform.GetComponentInChildren <SpriteRenderer>().sprite = barrelSprite;
        }
        gunStats = GunStats.Instance;

        shootSystem = transform.FindChild("FirePoint").GetComponent <ShootSystem>();
        shootSystem.ToInstantiate           = toInstatiate;
        shootSystem.AttackRate              = (float)gunStats.AttackRate;
        shootSystem.AmmoStats               = gunStats.AmmoStats;
        shootSystem.transform.localPosition = new Vector2(barrelSprite.rect.height / (Mathf.Abs(transform.parent.position.y)), 0.0f);
        controllGunSystem          = transform.GetComponent <ControllGunSystem>();
        controllGunSystem.MinAngle = (float)gunStats.MinAngle;
        controllGunSystem.MaxAngle = (float)gunStats.MaxAngle;
    }
Exemplo n.º 11
0
    public override void OnInspectorGUI()
    {
        ShootSystem obj = target as ShootSystem;

        //コメント
        obj.comment = EditorGUILayout.TextField("Comment", obj.comment);
        //基本設定
        obj.play_On_Awake       = EditorGUILayout.Toggle("PlayOnAwake", obj.play_On_Awake);
        obj.bullet              = (GameObject)EditorGUILayout.ObjectField("Bullet", obj.bullet, typeof(GameObject), false);
        obj.parent              = (Transform)EditorGUILayout.ObjectField("Parent", obj.parent, typeof(Transform), true);
        obj.lifeTime            = EditorGUILayout.FloatField("LifeTime", obj.lifeTime);
        obj.offset              = EditorGUILayout.Vector2Field("Offset", obj.offset);
        obj.default_Shoot_Sound = EditorGUILayout.Toggle("DefaultShootSound", obj.default_Shoot_Sound);

        EditorGUILayout.Space();

        //その他パラメータ
        obj.kind        = (ShootSystem.KIND)EditorGUILayout.EnumPopup("Kind", obj.kind);
        obj.other_Param = EditorGUILayout.Foldout(obj.other_Param, "Param");
        if (obj.other_Param == true)
        {
            EditorGUILayout.BeginVertical(GUI.skin.box);

            obj.max_Speed = EditorGUILayout.FloatField("MaxSpeed", obj.max_Speed);

            switch (obj.kind)
            {
            case ShootSystem.KIND.Odd:
                obj.num             = EditorGUILayout.IntField("Num", obj.num);
                obj.inter_Angle_Deg = EditorGUILayout.FloatField("InterAngle_Deg", obj.inter_Angle_Deg);
                break;

            case ShootSystem.KIND.Even:
                obj.num             = EditorGUILayout.IntField("Num", obj.num);
                obj.inter_Angle_Deg = EditorGUILayout.FloatField("InterAngle_Deg", obj.inter_Angle_Deg);
                break;

            case ShootSystem.KIND.Diffusion:
                obj.num = EditorGUILayout.IntField("Num", obj.num);
                obj.center_Angle_Deg = EditorGUILayout.FloatField("CenterAngle_Deg", obj.center_Angle_Deg);
                break;

            case ShootSystem.KIND.nWay:
                obj.num              = EditorGUILayout.IntField("Num", obj.num);
                obj.inter_Angle_Deg  = EditorGUILayout.FloatField("InterAngle_Deg", obj.inter_Angle_Deg);
                obj.center_Angle_Deg = EditorGUILayout.FloatField("CenterAngle_Deg", obj.center_Angle_Deg);
                break;

            case ShootSystem.KIND.Scatter:
                obj.shoot_Rate       = EditorGUILayout.FloatField("Rate", obj.shoot_Rate);
                obj.center_Angle_Deg = EditorGUILayout.FloatField("CenterAngle_Deg", obj.center_Angle_Deg);
                obj.arc_Deg          = EditorGUILayout.FloatField("Arc", obj.arc_Deg);
                obj.duration         = EditorGUILayout.FloatField("Duration", obj.duration);
                break;

            case ShootSystem.KIND.Spiral:
                obj.shoot_Rate       = EditorGUILayout.FloatField("Rate", obj.shoot_Rate);
                obj.inter_Angle_Deg  = EditorGUILayout.FloatField("InterAngle_Deg", obj.inter_Angle_Deg);
                obj.center_Angle_Deg = EditorGUILayout.FloatField("CenterAngle_Deg", obj.center_Angle_Deg);
                obj.duration         = EditorGUILayout.FloatField("Duration", obj.duration);
                break;
            }
            EditorGUILayout.Space();
            obj.angle_Noise = EditorGUILayout.FloatField("AngleNoise_Deg", obj.angle_Noise);
            obj.speed_Noise = EditorGUILayout.FloatField("SpeedNoise", obj.speed_Noise);
            EditorGUILayout.EndVertical();
        }

        EditorGUILayout.Space();

        //弾の連結
        obj.connect_Bullet = EditorGUILayout.Toggle("ConnectBullet", obj.connect_Bullet);
        if (obj.connect_Bullet)
        {
            EditorGUILayout.BeginVertical(GUI.skin.box);
            obj.connect_Num = EditorGUILayout.IntField("ConnectNum", obj.connect_Num);
            obj.speed_Diff  = EditorGUILayout.FloatField("SpeedDiff", obj.speed_Diff);
            obj.angle_Diff  = EditorGUILayout.FloatField("AngleDiff", obj.angle_Diff);
            EditorGUILayout.EndVertical();
        }

        //ループ
        obj.looping = EditorGUILayout.Toggle("Looping", obj.looping);
        if (obj.looping)
        {
            EditorGUILayout.BeginVertical(GUI.skin.box);
            obj.loop_Count        = EditorGUILayout.IntField("LoopCount", obj.loop_Count);
            obj.span              = EditorGUILayout.FloatField("Span", obj.span);
            obj.center_Angle_Diff = EditorGUILayout.FloatField("Angle_Diff", obj.center_Angle_Diff);
            EditorGUILayout.EndVertical();
        }

        //加速度
        obj.is_Acceleration = EditorGUILayout.Toggle("VelocityOverTime", obj.is_Acceleration);
        if (obj.is_Acceleration)
        {
            EditorGUILayout.BeginVertical(GUI.skin.box);
            if (obj.velocity_Forward == null)
            {
                obj.velocity_Forward = AnimationCurve.Linear(0, 0, obj.lifeTime, 1.0f);
                obj.velocity_Lateral = AnimationCurve.Linear(0, 0, obj.lifeTime, 1.0f);
            }
            obj.velocity_Forward = EditorGUILayout.CurveField("Forward", obj.velocity_Forward);
            obj.velocity_Lateral = EditorGUILayout.CurveField("Lateral", obj.velocity_Lateral);
            EditorGUILayout.EndVertical();
        }

        //描画順
        obj.is_Change_Sorting_Order = EditorGUILayout.Toggle("ChangeSortingOrder", obj.is_Change_Sorting_Order);
        if (obj.is_Change_Sorting_Order)
        {
            obj.sorting_Order      = EditorGUILayout.IntField("SortingOrder", obj.sorting_Order);
            obj.sorting_Order_Diff = EditorGUILayout.IntField("SortingOrder_Diff", obj.sorting_Order_Diff);
        }

        EditorUtility.SetDirty(obj);
    }
 void Start()
 {
     _renderer = GetComponent <Renderer>();
     _shoot    = GetComponentInChildren <ShootSystem>();
 }
Exemplo n.º 13
0
 public void Shoot(bool activateCallbacks = false)
 {
     ShootSystem.Shoot(activateCallbacks);
     AnimatorController.Shoot();
 }
    private bool is_Shooting = false;   //Updata内で1度だけ呼ぶよう、enableをfalseにするとObjectPoolのあれこれでよくない


    private void Awake()
    {
        _shoot = GetComponent <ShootSystem>();
    }
Exemplo n.º 15
0
 void Start()
 {
     hero         = GameObject.FindGameObjectWithTag("Player").transform;
     ssystem      = hero.GetComponent <ShootSystem>();
     lastPoseHero = hero.position;
 }