コード例 #1
0
ファイル: DroneController.cs プロジェクト: Rud156/AstroWorld
        /// <summary>
        /// Start is called on the frame when a script is enabled just before
        /// any of the Update methods is called the first time.
        /// </summary>
        void Start()
        {
            _droneAgent  = GetComponent <NavMeshAgent>();
            _droneAttack = GetComponent <DroneAttack>();

            _player        = GameObject.FindGameObjectWithTag(TagManager.Player)?.transform;
            _droneAnimator = GetComponent <Animator>();

            _droneAttacking = false;
        }
コード例 #2
0
ファイル: TempWeaponL3.cs プロジェクト: Abu262/Master-8
    public override void Atk(Transform barrel, AudioManager AM, bool isPlayer)
    {
        Vector2    barrelV = new Vector2(barrel.position.x, barrel.position.y);
        GameObject bullet  = Instantiate(bulletPrefab, barrelV, barrel.rotation);

        Rigidbody2D rb = bullet.GetComponent <Rigidbody2D>();

        MachineBullet MB = bullet.GetComponent <MachineBullet>();
        DroneAttack   DA = bullet.GetComponent <DroneAttack>();

        DA.isPlayer = isPlayer;
        MB.damage   = damage;
        MB.range    = range;
        MB.isPlayer = isPlayer;
    }
コード例 #3
0
    void Start()
    {
        _GM_   = GameObject.FindGameObjectWithTag("GM").GetComponent <GM>();
        player = _GM_.player;
        rb     = GetComponent <Rigidbody2D>();
        if (droneType == 1)
        {
            attackScript = GetComponent <DroneAttack>();
        }
        else
        {
            attackScript2 = GetComponent <Drone2Attack>();
        }

        anim = GetComponent <DroneAnimation>();
    }
コード例 #4
0
 public void SetDroneAttack(DroneAttack droneAttack)
 {
     DroneAttack = droneAttack;
 }