wangguan
2020-12-29 452c75675679c44cc39b04bdb7d330d7c5c14d5c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
namespace MoreMountains.NiceVibrations
{
    public class BallDemoWall : MonoBehaviour
    {
        protected RectTransform _rectTransform;
        protected BoxCollider2D _boxCollider2D;
 
        protected virtual void OnEnable()
        {
            _rectTransform = this.gameObject.GetComponent<RectTransform>();
            _boxCollider2D = this.gameObject.GetComponent<BoxCollider2D>();
 
            _boxCollider2D.size = new Vector2(_rectTransform.rect.size.x , _rectTransform.rect.size.y );
        }        
    }
}