Exemplo n.º 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;
    }
Exemplo n.º 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;
    }
Exemplo n.º 3
0
 void Awake()
 {
     OAExtentions.AssertObjectNotNull(bullets, "OARangedWeapon is missing OABulletPool!");
     lastFireCounter = fireCooldown;
 }