コード例 #1
0
 protected override void Initialization()
 {
     base.Initialization();
     if (_weapon.Owner != null)
     {
         _topDownController2D = _weapon.Owner.GetComponent <TopDownController2D>();
     }
 }
コード例 #2
0
 void Start()
 {
     if (TryGetComponent <TopDownController2D>(out var tdc2d))
     {
         _controller2D       = tdc2d;
         _obstaclesLayerMask = tdc2d.ObstaclesLayerMask;
         _2dController       = true;
     }
     else if (TryGetComponent <TopDownController3D>(out var tdc3d))
     {
         _controller3D       = tdc3d;
         _obstaclesLayerMask = tdc3d.ObstaclesLayerMask;
         _2dController       = false;
     }
 }