Ejemplo n.º 1
0
        public virtual void Init()
        {
            for (int i = 0; i < ActiveInstanceList.Count; i++)
            {
                ReturnInstance(ActiveInstanceList[i]);
            }

            ActiveInstanceList.Clear();
            totalObjectCount = 0;

            for (int i = 0; i < startGenerateNum; i++)
            {
                GenerateAtLast();
            }
        }
Ejemplo n.º 2
0
        public virtual void SetOriginal(T original)
        {
            if (original.Equals(this.original))
            {
                return;
            }
            this.original = original;

            for (int i = 0; i < InstanceList.Count; i++)
            {
                Destroy(InstanceList[i].gameObject);
            }

            InstanceList.Clear();
            ActiveInstanceList.Clear();
            deactiveInstanceList.Clear();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 先頭に追加
        /// </summary>
        public virtual T GenerateAtFirst()
        {
            T obj = GetInstance();

            //座標
            Vector3 generatePosition = startPosition;

            if (ActiveInstanceList.Count > 0)
            {
                generatePosition.z = ActiveInstanceList[0].transform.position.z - ObjectDistance.z;
            }

            obj.transform.position = generatePosition;

            //登録
            ActiveInstanceList.Remove(obj);
            ActiveInstanceList.Insert(0, obj);

            return(obj);
        }