示例#1
0
        void Awake()
        {
            if (!Application.isPlaying)
            {
                awakeAtPlaying = false;
                return;
            }

            awakeAtPlaying  = true;
            skin            = Resources.Load <GUISkin>("GUISkin/PoolGUISkin");
            m_DataAsset     = ConstantData.GetPoolDatas();
            m_DataAssetTemp = StreamTools.Clone <PoolDataAsset>(m_DataAsset);

            m_Railpm = Resources.LoadAssetAtPath <PhysicMaterial>("Assets/PhysXMaterial/Wall.physicMaterial");
            m_Ballpm = Resources.LoadAssetAtPath <PhysicMaterial>("Assets/PhysXMaterial/Ball.physicMaterial");
            if (m_Railpm == null || m_Ballpm == null)
            {
                Debug.LogError("Physic material is null");
            }
            m_Railpm.bounciness = m_DataAsset.RailBounciness;
            m_Ballpm.bounciness = m_DataAsset.BallBounciness;
        }