Ejemplo n.º 1
0
        public GroundDataList GetCreateGroundDatas(float locationY)
        {
            GroundDataList groundDataList = ReferencePool.Acquire <GroundDataList>();

            float x = Random.Range(-2f, 2f);

            groundDataList.Add(new Vector3(x, locationY, 1f), 2);

            return(groundDataList);
        }
Ejemplo n.º 2
0
        public GroundDataList GetCreateGroundDatas(float locationY)
        {
            GroundDataList groundDataList = ReferencePool.Acquire <GroundDataList>();

            double rand = Utility.Random.GetRandomDouble();

            float x = rand > 0.5 ? m_Left : m_Right;

            groundDataList.Add(new Vector3(x, locationY, 1f), 4);

            return(groundDataList);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 利用工厂类 生成地板
        /// </summary>
        /// <exception cref="GameFrameworkException"></exception>
        public void CreateGround()
        {
            if (m_CreateGround == null)
            {
                throw new GameFrameworkException("ICreateGround is valid");
            }

            //todo 生成数量
            int            createNum   = 1;
            GroundDataList groundDatas = m_CreateGround.GetCreateGroundDatas(GetGroundNextLocation());

            for (int i = 0; i < createNum; i++)
            {
                foreach (CreateGroundData data in groundDatas)
                {
                    m_CreateGroundManager.LoadGround(data.GroundLocation, data.GroundType);
                }
            }
        }