예제 #1
0
    void Start()
    {
        OAExtentions.AssertObjectNotNull(playerState, "Ocean is missing player reference");

        // Assure that the object has a trigger collider
        col           = GetComponent <Collider2D>();
        col.isTrigger = true;
    }
예제 #2
0
    void Awake()
    {
        OAExtentions.AssertObjectNotNull(
            prefab,
            $"OAObjectPool is missing prefab!"
            );

        OAExtentions.AssertObjectNotNull(
            prefab.GetComponent <OABallisticBullet>(),
            $"OAObjectPool prefab is no a OABallisticBullet!"
            );

        freePool = new OABallisticBullet[maxSize];

        for (var i = 0; i < size; i++)
        {
            InstantiateBullet(i);
        }

        pooledCount = size;
    }
예제 #3
0
 void Awake()
 {
     OAExtentions.AssertObjectNotNull(bullets, "OARangedWeapon is missing OABulletPool!");
     lastFireCounter = fireCooldown;
 }