protected virtual void Move() { // Set Velocity velocity.y -= projectileData.gravity.Value * Time.fixedDeltaTime; // Move transform.Translate(velocity * Time.fixedDeltaTime, Space.World); // Update Travle Dist float dist = velocity.magnitude * Time.fixedDeltaTime; projectileData.travelDist.ModFlat += dist; // Detect Object if (!DetectCreature(dist)) { DetectWall(dist); } // On Maxt Distance if (projectileData.travelDist.Value >= projectileData.travelDist.Max) { OnMaxDist(); ObjPoolingManager.Sleep(this); } // Rotate Towards Moving Dir if (rotateToMovingDir) { transform.right = velocity.normalized; } }
protected virtual void AnimEvent_DropMagazine() { if (droppedMagazinePrefab != null) { ObjPoolingManager.Spawn(droppedMagazinePrefab, magazineDropPos.position, transform.rotation); } }
public static void Sleep(this PoolingObj obj) { ObjPoolingManager.Sleep(obj); }
public static T Spawn <T>(this T prefab, Transform parent, Vector2 localPos, bool canCreateNew = true) where T : PoolingObj { return(ObjPoolingManager.Spawn(prefab, parent, localPos, canCreateNew)); }
public static T Spawn <T>(this T prefab, Vector2 pos, bool canCreateNew = true) where T : PoolingObj { return(ObjPoolingManager.Spawn(prefab, pos, canCreateNew)); }
private void DisableOnFinish() { ObjPoolingManager.Sleep(this); }
protected virtual void SelfSleep() { ObjPoolingManager.Sleep(this); }