Inheritance: MonoBehaviour
コード例 #1
1
        static WorldGenerator()
        {
            squaresHitboxesList = new List<Hitbox>();
            squaresHitboxesPool = new ObjectPool<Hitbox>(CreateSquareHitbox, RecycleSquareHitbox, RABBIT_BOX_POOL_SIZE);

            getVisiblesWindowsAsSquaresHitboxes = new EnumWindowsProc(GetVisiblesWindowsAsSquaresHitboxes_EnumWindowsProc);
        }
コード例 #2
0
ファイル: TestPooling.cs プロジェクト: adgaudio/vowpal_wabbit
        public void ObjectPoolTestFactory()
        {
            var factory1 = new Disposable();
            var factory2 = new Disposable();
            var objectPool = new ObjectPool<Disposable, Disposable>();

            objectPool.UpdateFactory(ObjectFactory.Create(factory1, d => d.Create()));
            var p3 = objectPool.GetOrCreate();
            p3.Dispose();

            objectPool.UpdateFactory(ObjectFactory.Create(factory2, d => d.Create()));
            Assert.IsTrue(factory1.Disposed);

            var p1 = objectPool.GetOrCreate();
            var p2 = objectPool.GetOrCreate();

            p1.Dispose();
            p2.Dispose();

            p1 = objectPool.GetOrCreate();
            p1.Dispose();

            objectPool.Dispose();

            factory1.AssertChildrenDisposed();
            Assert.AreEqual(1, factory1.Children.Count);

            factory2.AssertChildrenDisposed();
            Assert.AreEqual(2, factory2.Children.Count);

            Assert.IsTrue(factory2.Disposed);
        }
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();

            ReadIndex.Close();
            ReadIndex.Dispose();
            TableIndex.Close(removeFiles: false);

            var readers = new ObjectPool<ITransactionFileReader>("Readers", 2, 2, () => new TFChunkReader(Db, WriterCheckpoint));
            var lowHasher = new XXHashUnsafe();
            var highHasher = new Murmur3AUnsafe();
            TableIndex = new TableIndex(GetFilePathFor("index"), lowHasher, highHasher,
                                        () => new HashListMemTable(PTableVersions.Index64Bit, maxSize: MaxEntriesInMemTable*2),
                                        () => new TFReaderLease(readers),
                                        PTableVersions.Index64Bit,
                                        maxSizeForMemory: MaxEntriesInMemTable);
            ReadIndex = new ReadIndex(new NoopPublisher(),
                                      readers,
                                      TableIndex,
                                      0,
                                      additionalCommitChecks: true, 
                                      metastreamMaxCount: 1,
                                      hashCollisionReadLimit: Opts.HashCollisionReadLimitDefault);
            ReadIndex.Init(ChaserCheckpoint.Read());
        }
コード例 #4
0
        public static ObjectPool<Connection> GetConnectionPool(ConnectionSetting connectionSetting)
        {
            if (connectionSetting == null)
                throw new ArgumentNullException("connectionSetting");

            var key = connectionSetting.ConnectionString;

            ObjectPool<Connection> connectionPool = null;

            lock ((ConnectionPools as ICollection).SyncRoot)
            {
                if (ConnectionPools.ContainsKey(key))
                    connectionPool = ConnectionPools[key];

                if (connectionPool == null)
                {
                    connectionPool = new ObjectPool<Connection>(
                        new ConnectionFactory(connectionSetting),
                        new ObjectPool<Connection>.Configuration {
                            MinSize = connectionSetting.MinPoolSize,
                            MaxSize = connectionSetting.MaxPoolSize,
                            Timeout = connectionSetting.ConnectionTimeout });
                    ConnectionPools[key] = connectionPool;
                }
            }

            return connectionPool as ObjectPool<Connection>;
        }
コード例 #5
0
 public static AsteroidWallpaper New(ObjectPool big, ObjectPool small)
 {
     var instance = CreateInstance<AsteroidWallpaper>();
     instance.big = big;
     instance.small = small;
     return instance;
 }
コード例 #6
0
        public void TestAllocateAndFree()
        {
            var pool = new ObjectPool<TestElement>();
            pool.Initialize();

            Assert.IsTrue(pool.UsedListSize == 0 && pool.FreeListSize == 0);

            // allocate some instances
            var e1 = pool.Allocate();
            var e2 = pool.Allocate();

            Assert.IsTrue(pool.UsedListSize == 2 && pool.FreeListSize == 0);
            Assert.IsTrue(e1 != e2);
            Assert.IsTrue(e1.value == 0);

            // free both and then allocate two more again - we should get both back

            pool.Free(e1);
            pool.Free(e2);
            Assert.IsTrue(pool.UsedListSize == 0 && pool.FreeListSize == 2);

            var e3 = pool.Allocate();
            var e4 = pool.Allocate();
            Assert.IsTrue(pool.UsedListSize == 2 && pool.FreeListSize == 0);
            Assert.IsTrue(e3 == e2);
            Assert.IsTrue(e4 == e1);
        }
コード例 #7
0
ファイル: Player.cs プロジェクト: TeamGlitch/Glitch
    void Awake()
    {
        timeLastEnemyHitted = Time.time;
        trigger = GetComponentInChildren<BoxCollider>();
        sprite = transform.GetComponentInChildren<SpriteRenderer>();

        glitchPartPool = new ObjectPool(glitchPart);
        lives = 3;
        items = 0;

        //Instantiate the glitch fragments to avoid lag later in the game
        GameObject[] parts = new GameObject[100];
        for (int i = 0; i < 100; i++)
        {
            parts[i] = glitchPartPool.getObject();
        }
        for (int i = 0; i < 100; i++)
        {
            parts[i].SetActive(false);
        }

        boxUIActivatedRectTransform = boxUIActivated.GetComponent<RectTransform>();
        exclamationSize = boxUIActivatedRectTransform.sizeDelta;
        boxUIActivated.SetActive(false);
        guiRectTrans = gui.GetComponent<RectTransform>();
        slowFPSScript = transform.FindChild("Powers").GetComponentInChildren<SlowFPS>();
    }
コード例 #8
0
 public static Poolable AddPoolableComponent(GameObject newInstance, ObjectPool pool)
 {
     scriptBuiltInstance = true;
     var instance = newInstance.AddComponent<Poolable>();
     instance.pool = pool;
     return instance;
 }
コード例 #9
0
ファイル: TemplateBinder.cs プロジェクト: leloulight/Routing
        public TemplateBinder(
            UrlEncoder urlEncoder,
            ObjectPool<UriBuildingContext> pool,
            RouteTemplate template,
            RouteValueDictionary defaults)
        {
            if (urlEncoder == null)
            {
                throw new ArgumentNullException(nameof(urlEncoder));
            }

            if (pool == null)
            {
                throw new ArgumentNullException(nameof(pool));
            }

            if (template == null)
            {
                throw new ArgumentNullException(nameof(template));
            }

            _urlEncoder = urlEncoder;
            _pool = pool;
            _template = template;
            _defaults = defaults;

            // Any default that doesn't have a corresponding parameter is a 'filter' and if a value
            // is provided for that 'filter' it must match the value in defaults.
            _filters = new RouteValueDictionary(_defaults);
            foreach (var parameter in _template.Parameters)
            {
                _filters.Remove(parameter.Name);
            }
        }
コード例 #10
0
        private void ReOpenDb()
        {
            Db = new TFChunkDb(new TFChunkDbConfig(PathName,
                                                   new VersionedPatternFileNamingStrategy(PathName, "chunk-"),
                                                   10000,
                                                   0,
                                                   WriterCheckpoint,
                                                   ChaserCheckpoint,
                                                   new InMemoryCheckpoint(-1),
                                                   new InMemoryCheckpoint(-1)));

            Db.Open();

            var readers = new ObjectPool<ITransactionFileReader>("Readers", 2, 5, () => new TFChunkReader(Db, Db.Config.WriterCheckpoint));
            TableIndex = new TableIndex(Path.Combine(PathName, "index"),
                                        () => new HashListMemTable(MaxEntriesInMemTable * 2),
                                        () => new TFReaderLease(readers),
                                        MaxEntriesInMemTable);
            ReadIndex = new ReadIndex(new NoopPublisher(),
                                      readers,
                                      TableIndex,
                                      new ByLengthHasher(),
                                      0,
                                      additionalCommitChecks: true,
                                      metastreamMaxCount: MetastreamMaxCount);
            ReadIndex.Init(ChaserCheckpoint.Read());
        }
コード例 #11
0
ファイル: LookupResult.cs プロジェクト: ehsansajjad465/roslyn
 private LookupResult(ObjectPool<LookupResult> pool)
 {
     _pool = pool;
     _kind = LookupResultKind.Empty;
     _symbolList = new ArrayBuilder<Symbol>();
     _error = null;
 }
コード例 #12
0
ファイル: Program.cs プロジェクト: chivandikwa/ObjectPool
        static void Main(string[] args)
        {
            CancellationTokenSource cts = new CancellationTokenSource();

            // Create an opportunity for the user to cancel.
            Task.Run(() =>
            {
                if (Console.ReadKey().KeyChar == 'c' || Console.ReadKey().KeyChar == 'C')
                    cts.Cancel();
            });

            ObjectPool<TestClass> pool = new ObjectPool<TestClass>(() => new TestClass());

            // Create a high demand for MyClass objects.
            Parallel.For(0, 1000000, (i, loopState) =>
            {

                using(TestClass mc = pool.GetResource())
                {
                    Console.CursorLeft = 0;
                    // This is the bottleneck in our application. All threads in this loop
                    // must serialize their access to the static Console class.
                    Console.WriteLine("{0:####.####}", mc.GetValue(i));
                    // pool.PoolResource(mc); alternative to implementing repool in the dispose method
                }

                if (cts.Token.IsCancellationRequested)
                    loopState.Stop();

            });
            Console.WriteLine("Press the Enter key to exit.");
            Console.ReadLine();
            cts.Dispose();
        }
コード例 #13
0
        private void ReOpenDb()
        {
            Db = new TFChunkDb(new TFChunkDbConfig(PathName,
                                                   new VersionedPatternFileNamingStrategy(PathName, "chunk-"),
                                                   10000,
                                                   0,
                                                   WriterCheckpoint,
                                                   ChaserCheckpoint,
                                                   new InMemoryCheckpoint(-1),
                                                   new InMemoryCheckpoint(-1)));

            Db.Open();

            var readers = new ObjectPool<ITransactionFileReader>("Readers", 2, 5, () => new TFChunkReader(Db, Db.Config.WriterCheckpoint));
            var lowHasher = new XXHashUnsafe();
            var highHasher = new Murmur3AUnsafe();
            TableIndex = new TableIndex(Path.Combine(PathName, "index"), lowHasher, highHasher,
                                        () => new HashListMemTable(PTableVersions.Index64Bit, MaxEntriesInMemTable * 2),
                                        () => new TFReaderLease(readers),
                                        PTableVersions.Index64Bit,
                                        MaxEntriesInMemTable);
            ReadIndex = new ReadIndex(new NoopPublisher(),
                                      readers,
                                      TableIndex,
                                      0,
                                      additionalCommitChecks: true,
                                      metastreamMaxCount: MetastreamMaxCount,
                                      hashCollisionReadLimit: Opts.HashCollisionReadLimitDefault);
            ReadIndex.Init(ChaserCheckpoint.Read());
        }
コード例 #14
0
    // Use this for initialization
    public void Init () {
        mng.eventManager.StartListening(EventManager.EventType.PLAYER_DIED, PlayerDied);
        mng.eventManager.StartListening(EventManager.EventType.PLAYER_WIN, PlayerWin);
        mng.eventManager.StartListening(EventManager.EventType.COLOR_CHANGED, ColorChanged);

        aracnoBotPool = mng.poolManager.aracnoBotPool;      
    }
コード例 #15
0
 private LookupResult(ObjectPool<LookupResult> pool)
 {
     this.pool = pool;
     this.kind = LookupResultKind.Empty;
     this.symbolList = new ArrayBuilder<Symbol>();
     this.error = null;
 }
コード例 #16
0
 public CompilationData(Compilation comp)
 {
     _semanticModelsMap = new Dictionary<SyntaxTree, SemanticModel>();
     this.SuppressMessageAttributeState = new SuppressMessageAttributeState(comp);
     _declarationAnalysisDataMap = new Dictionary<SyntaxReference, DeclarationAnalysisData>();
     _declarationAnalysisDataPool = new ObjectPool<DeclarationAnalysisData>(() => new DeclarationAnalysisData());
 }
コード例 #17
0
 void Start()
 {
     if(explosionPool == null && explosionRep != null) {
         explosionPool = PoolManager.Instance.GetPoolByRepresentative(explosionRep);
     }
     base.Start ();
 }
コード例 #18
0
    // Use this for initialization
    void Start ()
    {
        colorObjMng = rsc.coloredObjectsMng;
        voxelPool = rsc.poolMng.voxelPool;
        voxelColliderPool = rsc.poolMng.voxelColliderPool;

        mat = colorObjMng.GetVoxelRandomMaterial();

        if (!includeChildren)
        {
            transf = gameObject.transform;
            rend = gameObject.GetComponent<Renderer>();
            meshFilter = gameObject.GetComponent<MeshFilter>();
            sRend = gameObject.GetComponent<SkinnedMeshRenderer>();
        }
        else
        {
            transforms = new List<Transform>();
            renderers = new List<Renderer>();
            isSkinedMeshRenderer = new List<bool>();
            meshFilters = new List<MeshFilter>();
            meshes = new List<Mesh>();

            PopulateLists(gameObject);
        }

        voxelScale = new Vector3(voxelSideSize, voxelSideSize, voxelSideSize);
    }
コード例 #19
0
ファイル: ObjectPoolTest.cs プロジェクト: aloneguid/support
        public void AddInstance_UpToTheLimit_CountersCorrect()
        {
            int i = 0;

             var pool = new ObjectPool<PoolObject>(
            () => new PoolObject((i++).ToString()),
            null,
            2,
            TimeSpan.MaxValue);
             Assert.Equal(0, pool.InstanceCount);
             Assert.False(pool.HasFreeInstance);

             //first instance
             PoolObject obj1 = pool.GetInstance();
             Assert.Equal(1, pool.InstanceCount);
             Assert.False(pool.HasFreeInstance);

             //second instance
             PoolObject obj2 = pool.GetInstance();
             Assert.Equal(2, pool.InstanceCount);
             Assert.False(pool.HasFreeInstance);

             //third instance
             new Thread(() => { pool.ReleaseInstance(obj1);}).Start();

             PoolObject obj3 = pool.GetInstance();
             Assert.Equal(2, pool.InstanceCount);
             Assert.False(pool.HasFreeInstance);
             Assert.True(ReferenceEquals(obj3, obj1));

             pool.Dispose();

             Assert.Equal(0, pool.InstanceCount);
             Assert.False(pool.HasFreeInstance);
        }
コード例 #20
0
        private static void Main(string[] args)
        {
            CancellationTokenSource cts = new CancellationTokenSource();
            Task task = new Task(() =>
            {
                if (Console.ReadKey().KeyChar == 'c' || Console.ReadKey().KeyChar == 'C')
                {
                    cts.Cancel();
                }
            });
            task.Start();

            ObjectPool<MyClass> pool = new ObjectPool<MyClass>(() => new MyClass());

            Parallel.For(0, 1000000, (i, loopstate) =>
            {
                MyClass mc = pool.GetObject();
                Console.CursorLeft = 0;
                Console.WriteLine("{0:####.####}", mc.GetValue(i));

                pool.PutObject(mc);
                if (cts.Token.IsCancellationRequested)
                {
                    loopstate.Stop();
                }
            });

            Console.WriteLine("Press the Enter key to exit.");
            Console.ReadLine();
        }
コード例 #21
0
	void InitPool ()
	{
		pool = new ObjectPool<DynamicBrick> (initSize, addSize);
		pool.NewObject = NewDynamicBrick;
		pool.Init ();
		
	}
コード例 #22
0
	void InitPool ()
	{
		m_Pool_Brick = new ObjectPool<Brick> (100, 20);
		m_Pool_Brick.NewObject = NewBrick;
		m_Pool_Brick.Init ();
		
	}
コード例 #23
0
ファイル: Access.cs プロジェクト: shengqh/RCPA.Core
 public Access(string accessFileName)
 {
   var acFile = accessFileName.Replace('\\', '/').Replace("//", "/");
   this.connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}", acFile);
   this.pool = new ObjectPool<OleDbConnection>(() => new OleDbConnection(connectionString));
   this.PageSize = 14;
 }
コード例 #24
0
    // Use this for initialization
    void Start () {
        //voxelPool = mng.poolManager.voxelPool;
        voxelScriptPool = mng.poolManager.voxelControllerPool;
        voxelColliderPool = mng.poolManager.voxelColliderPool;

        mat = redMaterial;

        if (!includeChildren)
        {
            transf = gameObject.transform;
            rend = gameObject.GetComponent<Renderer>();
            meshFilter = gameObject.GetComponent<MeshFilter>();
            sRend = gameObject.GetComponent<SkinnedMeshRenderer>();
        }
        else
        {
            transforms = new List<Transform>();
            renderers = new List<Renderer>();
            isSkinedMeshRenderer = new List<bool>();
            meshFilters = new List<MeshFilter>();
            meshes = new List<Mesh>();

            PopulateLists(gameObject);
        }

        voxelScale = new Vector3(voxelSideSize, voxelSideSize, voxelSideSize);
    }
コード例 #25
0
        /// <summary>
        /// Initializes the game board.
        /// </summary>
        /// <param name="width">The width of the board.</param>
        /// <param name="height">The height of the board.</param>
        /// <param name="initialDensity">The initial population density to use to populate the board.</param>
        /// <param name="pool">The pool of Bitmaps to use.</param>
        /// <param name="ruleSet">The rule set.</param>
        public GameBoard(int width, int height, double initialDensity, ObjectPool<Bitmap> pool, string ruleSet)
        {
            // Validate parameters
            if (width < 1) throw new ArgumentOutOfRangeException("width");
            if (height < 1) throw new ArgumentOutOfRangeException("height");
            if (pool == null) throw new ArgumentNullException("pool");
            if (ruleSet == null) throw new ArgumentNullException("pool");
            if (initialDensity < 0 || initialDensity > 1) throw new ArgumentOutOfRangeException("initialDensity");

            // Store parameters
            _pool = pool;
            Width = width;
            Height = height;
            _ruleSet = ruleSet;

            // Create the storage arrays
            _scratch = new Color?[2][,] { new Color?[width, height], new Color?[width, height] };

            // Populate the board randomly based on the provided initial density
            Random rand = new Random();
            for (int i = 0; i < width; i ++)
            {
                for (int j = 0; j < height; j++)
                {
                    _scratch[_currentIndex][i, j] = (rand.NextDouble() < initialDensity) ? Color.FromArgb(rand.Next()) : (Color?)null;
                }
            }
        }
コード例 #26
0
 // Use this for initialization
 public void Awake()
 {
     player = GameObject.FindGameObjectWithTag ("Player");
     playerController = player.GetComponent<PlayerController>();
     gameController = GameObject.Find("GameController").GetComponent<GameController>();
     objectPool = GameObject.Find("Pool").GetComponent<ObjectPool>();
 }
コード例 #27
0
ファイル: AimedTurret.cs プロジェクト: EternalGB/frogue
 void OnEnable()
 {
     target = null;
     canFire = true;
     anim = GetComponent<Animator>();
     projPool = PoolManager.Instance.GetPoolByRepresentative(projectile);
 }
コード例 #28
0
 ///////////////////////////////////////////////	
 private GameObject GetObstacle(ObjectPool pool)
 {
     GameObject obstacle = pool.getNextObject ();
     var pos = pool.prototype.transform.position;
     obstacle.transform.position = new Vector3 (pos.x, pos.y, pos.z);
     return obstacle;
 }
コード例 #29
0
 protected override void Awake()
 {
     base.Awake();
     GameObject gameController = GameObject.FindGameObjectWithTag(Tags.GAMECONTROLLER);
     _gameController = gameController.GetComponent<GameController>();
     _objectPool = gameController.GetComponent<ObjectPool>();
 }
コード例 #30
0
ファイル: RpcServerRuntime.cs プロジェクト: Indifer/Test
		internal RpcServerRuntime( RpcServerConfiguration configuration, SerializationContext serializationContext )
		{
			this._configuration = configuration;
			this._serializationContext = serializationContext;
			this._applicationContextPool =
				configuration.ApplicationContextPoolProvider(
					() => new RpcApplicationContext(
						configuration.ExecutionTimeout,
						configuration.HardExecutionTimeout
					),
				configuration.CreateApplicationContextPoolConfiguration()
			);
			this._softTimeoutDetails =
				new MessagePackObject(
					new MessagePackObjectDictionary()
					{
						{ RpcException.MessageKeyUtf8, "Execution timeout." },
						{ 
							RpcException.DebugInformationKeyUtf8, 
							String.Format( 
								CultureInfo.InvariantCulture, 
								"{{ \"ExecutionTimeout\" : \"{0}\", \"HardExecutionTimeout\" : \"{1}\" }}",
								configuration.ExecutionTimeout,
								configuration.HardExecutionTimeout
							)
						}
					},
					true
				);
		}
コード例 #31
0
 private void Awake()
 {
     objectPool = ObjectPool.Instance;
 }
コード例 #32
0
 public static GameObject Spawn(this GameObject prefab, Transform parent, Vector3 position, Quaternion rotation)
 {
     return(ObjectPool.Spawn(prefab, parent, position, rotation));
 }
コード例 #33
0
 public static void RecycleAll <T>(this T prefab) where T : Component
 {
     ObjectPool.RecycleAll(prefab);
 }
コード例 #34
0
 public static void Recycle(this GameObject obj)
 {
     ObjectPool.Recycle(obj);
 }
コード例 #35
0
 public static void Recycle <T>(this T obj) where T : Component
 {
     ObjectPool.Recycle(obj);
 }
コード例 #36
0
 public static GameObject Spawn(this GameObject prefab)
 {
     return(ObjectPool.Spawn(prefab, null, Vector3.zero, Quaternion.identity));
 }
コード例 #37
0
 public static GameObject Spawn(this GameObject prefab, Transform parent)
 {
     return(ObjectPool.Spawn(prefab, parent, Vector3.zero, Quaternion.identity));
 }
コード例 #38
0
 public static GameObject Spawn(this GameObject prefab, Vector3 position)
 {
     return(ObjectPool.Spawn(prefab, null, position, Quaternion.identity));
 }
コード例 #39
0
 public static T Spawn <T>(this T prefab, Transform parent) where T : Component
 {
     return(ObjectPool.Spawn(prefab, parent, Vector3.zero, Quaternion.identity));
 }
コード例 #40
0
 public static T Spawn <T>(this T prefab) where T : Component
 {
     return(ObjectPool.Spawn(prefab, null, Vector3.zero, Quaternion.identity));
 }
コード例 #41
0
 public static void CreatePool(this GameObject prefab, int initialPoolSize)
 {
     ObjectPool.CreatePool(prefab, initialPoolSize);
 }
コード例 #42
0
 public static T Spawn <T>(this T prefab, Vector3 position, Quaternion rotation) where T : Component
 {
     return(ObjectPool.Spawn(prefab, null, position, rotation));
 }
コード例 #43
0
 public static void CreatePool <T>(this T prefab, int initialPoolSize) where T : Component
 {
     ObjectPool.CreatePool(prefab, initialPoolSize);
 }
コード例 #44
0
 public static void CreatePool(this GameObject prefab)
 {
     ObjectPool.CreatePool(prefab, 0);
 }
コード例 #45
0
 void Awake()
 {
     _instance = this;
 }
コード例 #46
0
 public static void CreatePool <T>(this T prefab) where T : Component
 {
     ObjectPool.CreatePool(prefab, 0);
 }
コード例 #47
0
 void Awake()
 {
     pool = GetComponent <ObjectPool>();
 }
コード例 #48
0
 public Rewriter(ObjectPool <IReductionRewriter> pool) : base(pool)
 {
 }
コード例 #49
0
 private OrderPreservingMultiDictionary(ObjectPool <OrderPreservingMultiDictionary <K, V> > pool)
 {
     _pool = pool;
 }
コード例 #50
0
 // Use this for initialization
 void Start()
 {
     pool    = GameObject.Find("pool");
     objPool = pool.GetComponent <ObjectPool>();
 }
コード例 #51
0
 public Service(ref ObjectPool <IDbConnection> pool)
 {
     this.connectionPool = pool;
 }
コード例 #52
0
ファイル: EnterPoint.cs プロジェクト: spbsmile/Caveman
 protected void CreateCachePools()
 {
     poolStones       = poolsManager.Stones;
     poolBonusesSpeed = poolsManager.BonusesSpeed;
 }
コード例 #53
0
 public TuioInput()
 {
     touchPool  = new ObjectPool <TouchPointer>(20, () => new TouchPointer(this), null, resetPointer);
     objectPool = new ObjectPool <ObjectPointer>(10, () => new ObjectPointer(this), null, resetPointer);
 }
コード例 #54
0
ファイル: AudioClipPlayer.cs プロジェクト: pavel-fadrhonc/of2
 public void Setup(Pool.ObjectPool pool, GlobalAudioManager manager, SignalBus signalBus)
 {
     m_ClipPool      = pool;
     m_AudioManager  = manager;
     this._signalBus = signalBus;
 }
コード例 #55
0
 public static void RecycleAll(this GameObject prefab)
 {
     ObjectPool.RecycleAll(prefab);
 }
コード例 #56
0
 public DefaultClaimUidExtractor(ObjectPool <AntiforgerySerializationContext> pool)
 {
     _pool = pool;
 }
コード例 #57
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TriggerCommandBuilder"/> class.
 /// </summary>
 /// <param name="objectPool">The object pool.</param>
 public TriggerCommandBuilder(ObjectPool <StringBuilder> objectPool)
 {
     ObjectPool = objectPool;
 }
コード例 #58
0
 public PickUpPool(ObjectPool objectpool, float poolweight)
 {
     objectPool = objectpool;
     poolWeight = poolweight;
 }
コード例 #59
0
 public static int CountPooled <T>(this T prefab) where T : Component
 {
     return(ObjectPool.CountPooled(prefab));
 }
コード例 #60
0
 void Awake()
 {
     shopItemsPool = new ObjectPool <ShopItem>(ShopItemPrefab, transform);
 }