Exemplo n.º 1
0
    void shot()
    {
        marble = Instantiate(modelMarble, this.transform.position, this.transform.rotation);
        EnemyShotManager shotmanager = marble.GetComponent <EnemyShotManager>();

        shotmanager.Create(shotCurve, shotSpeed);
    }
Exemplo n.º 2
0
    /*----------------------------*/

    void Awake()
    {
        po = transform.Find("Cannon").gameObject.GetComponent <PutObject>();
        ec = GetComponent <EnemyController>();
        ec.SetTriggerFunc(BodyEnter, BodyExit, BodyStay, NearEnter, NearExit, NearStay);
        esm = GetComponent <EnemyShotManager>();
    }
Exemplo n.º 3
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        EnemyShotManager enemyShotManager = target as EnemyShotManager;
        EnemyBulletParam param            = enemyShotManager.param;

        EditorGUILayout.LabelField("共通パラメータ");
        EditorGUI.indentLevel++;

        enemyShotManager.bullet = EditorGUILayout.ObjectField("Bulletクラス", enemyShotManager.bullet, typeof(EnemyBullet), true) as EnemyBullet;
        var speed = serializedObject.FindProperty("param.speed");

        speed.floatValue      = EditorGUILayout.FloatField("弾丸の速度", speed.floatValue);
        param.shotDelay       = EditorGUILayout.FloatField("ショット間隔", param.shotDelay);
        param.power           = EditorGUILayout.FloatField("攻撃力", param.power);
        param.lifeTime        = EditorGUILayout.FloatField("生存時間", param.lifeTime);
        param.isPenetrate     = EditorGUILayout.Toggle("貫通性", param.isPenetrate);
        param.initialPosition = EditorGUILayout.Vector3Field("ローカル初期位置", param.initialPosition);
        param.shotSound       = EditorGUILayout.ObjectField("ショット音", param.shotSound, typeof(AudioClip), true) as AudioClip;

        EditorGUILayout.Space();

        EditorGUILayout.LabelField("指定弾数撃った後のショット間隔");
        param.shotDelay2 = EditorGUILayout.FloatField("", param.shotDelay2);
        EditorGUILayout.LabelField("追加遅延のための指定弾数");
        param.delayShotCount = EditorGUILayout.IntField("", param.delayShotCount);

        EditorGUI.indentLevel--;
        EditorGUILayout.Space();

        EditorGUILayout.LabelField("分岐パラメータ");
        EditorGUI.indentLevel++;
        param.shotMovePattern = (ShotMovePattern)EditorGUILayout.EnumPopup("ショットの種類", param.shotMovePattern);

        switch (param.shotMovePattern)
        {
        case ShotMovePattern.Straight:
        case ShotMovePattern.PlayerAim:
            break;

        case ShotMovePattern.EveryDirection:
            param.angleInterval = EditorGUILayout.FloatField("角度間隔", param.angleInterval);
            break;

        case ShotMovePattern.Tornado:
            param.spinSpeed = EditorGUILayout.FloatField("回転速度", param.spinSpeed);
            break;
        }

        EditorUtility.SetDirty(target);
        serializedObject.ApplyModifiedProperties();
    }
Exemplo n.º 4
0
 private void Start()
 {
     esm = GetComponent <EnemyShotManager>();
 }
Exemplo n.º 5
0
    private bool toPlayerNotWall; //自分とプレイヤーの間に障害物がないか

    private void Awake()
    {
        ec     = GetComponent <EnemyController>();
        esm    = GetComponent <EnemyShotManager>();
        cannon = transform.Find("Cannon").gameObject;
    }
Exemplo n.º 6
0
 void Start()
 {
     esm    = GetComponent <EnemyShotManager>();
     head   = this.transform.Find("Cannon/Head").gameObject;
     turret = this.transform.Find("Cannon/Turret").gameObject;
 }